iio: hid-sensor-magn-3d: Scan for usage attributes before setting up iio channels
authorReyad Attiyat <reyad.attiyat@gmail.com>
Thu, 17 Jul 2014 18:18:00 +0000 (19:18 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 20 Jul 2014 12:37:52 +0000 (13:37 +0100)
commit2a96540a5c0d136c3c412ec650fad301aaf12bf7
tree8ee00e69e046591c6f50c2cea03714a937b2da1b
parent11b8ddab817eb8070a542d33caeb93cccfa4e383
iio: hid-sensor-magn-3d: Scan for usage attributes before setting up iio channels

Scan for and count the HID usage attributes supported by the driver.
This allows for the driver to only setup the IIO channels for the
sensor usages present in the HID USB reports.

Changes from v5
-Fixed kernel panic from invalid pointer dereference
-Fixed variable assignment style

Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/magnetometer/hid-sensor-magn-3d.c