Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: hid-sensor-als: add module alias for autoload

Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.

This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Alexander Holler and committed by
Jonathan Cameron
5b812ea5 a411e735

+11 -5
+11 -5
drivers/iio/light/hid-sensor-als.c
··· 30 30 #include <linux/iio/triggered_buffer.h> 31 31 #include "../common/hid-sensors/hid-sensor-trigger.h" 32 32 33 - /*Format: HID-SENSOR-usage_id_in_hex*/ 34 - /*Usage ID from spec for Ambiant-Light: 0x200041*/ 35 - #define DRIVER_NAME "HID-SENSOR-200041" 36 - 37 33 #define CHANNEL_SCAN_INDEX_ILLUM 0 38 34 39 35 struct als_state { ··· 351 355 return 0; 352 356 } 353 357 358 + static struct platform_device_id hid_als_ids[] = { 359 + { 360 + /* Format: HID-SENSOR-usage_id_in_hex_lowercase */ 361 + .name = "HID-SENSOR-200041", 362 + }, 363 + { /* sentinel */ } 364 + }; 365 + MODULE_DEVICE_TABLE(platform, hid_als_ids); 366 + 354 367 static struct platform_driver hid_als_platform_driver = { 368 + .id_table = hid_als_ids, 355 369 .driver = { 356 - .name = DRIVER_NAME, 370 + .name = KBUILD_MODNAME, 357 371 .owner = THIS_MODULE, 358 372 }, 359 373 .probe = hid_als_probe,