Re: [PATCH 1/3] iio: adc: Add module device table for autoloading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/11/14 19:30, Jacob Pan wrote:
> From: Aaron Lu <aaron.lu@xxxxxxxxx>
> 
> Add the module device id table so that the driver can be automatically
> loaded once the platform device is created.
> 
> Signed-off-by: Aaron Lu <aaron.lu@xxxxxxxxx>
> Signed-off-by: Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>
Acked-by: Jonathan Cameron <jic23@xxxxxxxxxx>
> ---
>  drivers/iio/adc/axp288_adc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/iio/adc/axp288_adc.c b/drivers/iio/adc/axp288_adc.c
> index 4800286..4a6cf43 100644
> --- a/drivers/iio/adc/axp288_adc.c
> +++ b/drivers/iio/adc/axp288_adc.c
> @@ -238,15 +238,23 @@ static int axp288_adc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static struct platform_device_id axp288_adc_id_table[] = {
> +	{ .name = "axp288_adc" },
> +	{},
> +};
> +
>  static struct platform_driver axp288_adc_driver = {
>  	.probe = axp288_adc_probe,
>  	.remove = axp288_adc_remove,
> +	.id_table = axp288_adc_id_table,
>  	.driver = {
>  		.name = "axp288_adc",
>  		.owner = THIS_MODULE,
>  	},
>  };
>  
> +MODULE_DEVICE_TABLE(platform, axp288_adc_id_table);
> +
>  module_platform_driver(axp288_adc_driver);
>  
>  MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>");
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux