iio: adc: sun4i-gpadc-iio: Fix module autoload when PLATFORM devices are registered
authorEduardo Molinas <edu.molinas@gmail.com>
Mon, 1 May 2017 22:45:58 +0000 (18:45 -0400)
committerJonathan Cameron <jic23@kernel.org>
Sun, 7 May 2017 13:44:42 +0000 (14:44 +0100)
If the driver is built as a module, it won't be autloaded if the devices
are registered via PLATFORM code because the PLATFORM device table
entries are not exported as aliases

Before the patch:
$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
$

After the patch:
$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

Signed-off-by: Eduardo Molinas <edu.molinas@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/sun4i-gpadc-iio.c

index b235273..c3d7ba1 100644 (file)
@@ -700,6 +700,7 @@ static const struct platform_device_id sun4i_gpadc_id[] = {
        { "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data },
        { /* sentinel */ },
 };
+MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id);
 
 static struct platform_driver sun4i_gpadc_driver = {
        .driver = {