2021-05-12 09:43:26

by Chunyan Zhang

[permalink] [raw]
Subject: [PATCH] iio: adc: Add missing MODULE_DEVICE_TABLE

From: Chunyan Zhang <[email protected]>

MODULE_DEVICE_TABLE is used to extract the device information out of the
driver and builds a table when being compiled. If using this macro,
kernel can find the driver if available when the device is plugged in,
and then loads that driver and initializes the device.

Signed-off-by: Chunyan Zhang <[email protected]>
---
drivers/iio/adc/sc27xx_adc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/sc27xx_adc.c b/drivers/iio/adc/sc27xx_adc.c
index 301cf66de695..00098caf6d9e 100644
--- a/drivers/iio/adc/sc27xx_adc.c
+++ b/drivers/iio/adc/sc27xx_adc.c
@@ -549,6 +549,7 @@ static const struct of_device_id sc27xx_adc_of_match[] = {
{ .compatible = "sprd,sc2731-adc", },
{ }
};
+MODULE_DEVICE_TABLE(of, sc27xx_adc_of_match);

static struct platform_driver sc27xx_adc_driver = {
.probe = sc27xx_adc_probe,
--
2.25.1


2021-05-13 22:36:02

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH] iio: adc: Add missing MODULE_DEVICE_TABLE

On Wed, 12 May 2021 17:38:44 +0800
Chunyan Zhang <[email protected]> wrote:

> From: Chunyan Zhang <[email protected]>
>
> MODULE_DEVICE_TABLE is used to extract the device information out of the
> driver and builds a table when being compiled. If using this macro,
> kernel can find the driver if available when the device is plugged in,
> and then loads that driver and initializes the device.
>
> Signed-off-by: Chunyan Zhang <[email protected]>

Applied to the togreg branch of iio.git and pushed out as testing to see
if 0-day can find anything we missed.

Thanks,

Jonathan

> ---
> drivers/iio/adc/sc27xx_adc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/adc/sc27xx_adc.c b/drivers/iio/adc/sc27xx_adc.c
> index 301cf66de695..00098caf6d9e 100644
> --- a/drivers/iio/adc/sc27xx_adc.c
> +++ b/drivers/iio/adc/sc27xx_adc.c
> @@ -549,6 +549,7 @@ static const struct of_device_id sc27xx_adc_of_match[] = {
> { .compatible = "sprd,sc2731-adc", },
> { }
> };
> +MODULE_DEVICE_TABLE(of, sc27xx_adc_of_match);
>
> static struct platform_driver sc27xx_adc_driver = {
> .probe = sc27xx_adc_probe,