All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching
@ 2022-05-01 10:34 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-01 10:34 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, linux-iio, linux-stm32, linux-arm-kernel,
	linux-kernel
  Cc: Krzysztof Kozlowski

The of_device_id was added to allow module autoloading, but it should be
also used to allow driver matching via Devicetree.

This also fixes W=1 warning:
  drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/iio/adc/stmpe-adc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c
index d2d405388499..0208789fc0f5 100644
--- a/drivers/iio/adc/stmpe-adc.c
+++ b/drivers/iio/adc/stmpe-adc.c
@@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);
 
+static const struct of_device_id stmpe_adc_ids[] = {
+	{ .compatible = "st,stmpe-adc", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
+
 static struct platform_driver stmpe_adc_driver = {
 	.probe		= stmpe_adc_probe,
 	.driver		= {
 		.name	= "stmpe-adc",
 		.pm	= &stmpe_adc_pm_ops,
+		.of_match_table = stmpe_adc_ids,
 	},
 };
 module_platform_driver(stmpe_adc_driver);
 
-static const struct of_device_id stmpe_adc_ids[] = {
-	{ .compatible = "st,stmpe-adc", },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
-
 MODULE_AUTHOR("Stefan Agner <stefan.agner@toradex.com>");
 MODULE_DESCRIPTION("STMPEXXX ADC driver");
 MODULE_LICENSE("GPL v2");
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching
@ 2022-05-01 10:34 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-01 10:34 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, linux-iio, linux-stm32, linux-arm-kernel,
	linux-kernel
  Cc: Krzysztof Kozlowski

The of_device_id was added to allow module autoloading, but it should be
also used to allow driver matching via Devicetree.

This also fixes W=1 warning:
  drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/iio/adc/stmpe-adc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c
index d2d405388499..0208789fc0f5 100644
--- a/drivers/iio/adc/stmpe-adc.c
+++ b/drivers/iio/adc/stmpe-adc.c
@@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);
 
+static const struct of_device_id stmpe_adc_ids[] = {
+	{ .compatible = "st,stmpe-adc", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
+
 static struct platform_driver stmpe_adc_driver = {
 	.probe		= stmpe_adc_probe,
 	.driver		= {
 		.name	= "stmpe-adc",
 		.pm	= &stmpe_adc_pm_ops,
+		.of_match_table = stmpe_adc_ids,
 	},
 };
 module_platform_driver(stmpe_adc_driver);
 
-static const struct of_device_id stmpe_adc_ids[] = {
-	{ .compatible = "st,stmpe-adc", },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
-
 MODULE_AUTHOR("Stefan Agner <stefan.agner@toradex.com>");
 MODULE_DESCRIPTION("STMPEXXX ADC driver");
 MODULE_LICENSE("GPL v2");
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] iio: ti-ads8688: use of_device_id for OF matching
  2022-05-01 10:34 ` Krzysztof Kozlowski
@ 2022-05-01 10:34   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-01 10:34 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, linux-iio, linux-stm32, linux-arm-kernel,
	linux-kernel
  Cc: Krzysztof Kozlowski

The of_device_id was added to allow module autoloading, but it should be
also used to allow driver matching via Devicetree.

This also fixes W=1 warning:
  drivers/iio/adc/ti-ads8688.c:501:34: error: ‘ads8688_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/iio/adc/ti-ads8688.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/ti-ads8688.c b/drivers/iio/adc/ti-ads8688.c
index 22c2583eedd0..708cca0a63be 100644
--- a/drivers/iio/adc/ti-ads8688.c
+++ b/drivers/iio/adc/ti-ads8688.c
@@ -508,6 +508,7 @@ MODULE_DEVICE_TABLE(of, ads8688_of_match);
 static struct spi_driver ads8688_driver = {
 	.driver = {
 		.name	= "ads8688",
+		.of_match_table = ads8688_of_match,
 	},
 	.probe		= ads8688_probe,
 	.remove		= ads8688_remove,
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] iio: ti-ads8688: use of_device_id for OF matching
@ 2022-05-01 10:34   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-01 10:34 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, linux-iio, linux-stm32, linux-arm-kernel,
	linux-kernel
  Cc: Krzysztof Kozlowski

The of_device_id was added to allow module autoloading, but it should be
also used to allow driver matching via Devicetree.

This also fixes W=1 warning:
  drivers/iio/adc/ti-ads8688.c:501:34: error: ‘ads8688_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/iio/adc/ti-ads8688.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/ti-ads8688.c b/drivers/iio/adc/ti-ads8688.c
index 22c2583eedd0..708cca0a63be 100644
--- a/drivers/iio/adc/ti-ads8688.c
+++ b/drivers/iio/adc/ti-ads8688.c
@@ -508,6 +508,7 @@ MODULE_DEVICE_TABLE(of, ads8688_of_match);
 static struct spi_driver ads8688_driver = {
 	.driver = {
 		.name	= "ads8688",
+		.of_match_table = ads8688_of_match,
 	},
 	.probe		= ads8688_probe,
 	.remove		= ads8688_remove,
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching
  2022-05-01 10:34 ` Krzysztof Kozlowski
@ 2022-05-01 18:00   ` Jonathan Cameron
  -1 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2022-05-01 18:00 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue, linux-iio,
	linux-stm32, linux-arm-kernel, linux-kernel

On Sun,  1 May 2022 12:34:46 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> The of_device_id was added to allow module autoloading, but it should be
> also used to allow driver matching via Devicetree.
> 
> This also fixes W=1 warning:
>   drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Series applied to the togreg branch of iio.git and pushed out as testing for 0-day
to poke at it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/stmpe-adc.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c
> index d2d405388499..0208789fc0f5 100644
> --- a/drivers/iio/adc/stmpe-adc.c
> +++ b/drivers/iio/adc/stmpe-adc.c
> @@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev)
>  
>  static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);
>  
> +static const struct of_device_id stmpe_adc_ids[] = {
> +	{ .compatible = "st,stmpe-adc", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> +
>  static struct platform_driver stmpe_adc_driver = {
>  	.probe		= stmpe_adc_probe,
>  	.driver		= {
>  		.name	= "stmpe-adc",
>  		.pm	= &stmpe_adc_pm_ops,
> +		.of_match_table = stmpe_adc_ids,
>  	},
>  };
>  module_platform_driver(stmpe_adc_driver);
>  
> -static const struct of_device_id stmpe_adc_ids[] = {
> -	{ .compatible = "st,stmpe-adc", },
> -	{ },
> -};
> -MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> -
>  MODULE_AUTHOR("Stefan Agner <stefan.agner@toradex.com>");
>  MODULE_DESCRIPTION("STMPEXXX ADC driver");
>  MODULE_LICENSE("GPL v2");


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching
@ 2022-05-01 18:00   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2022-05-01 18:00 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue, linux-iio,
	linux-stm32, linux-arm-kernel, linux-kernel

On Sun,  1 May 2022 12:34:46 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> The of_device_id was added to allow module autoloading, but it should be
> also used to allow driver matching via Devicetree.
> 
> This also fixes W=1 warning:
>   drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Series applied to the togreg branch of iio.git and pushed out as testing for 0-day
to poke at it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/stmpe-adc.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c
> index d2d405388499..0208789fc0f5 100644
> --- a/drivers/iio/adc/stmpe-adc.c
> +++ b/drivers/iio/adc/stmpe-adc.c
> @@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev)
>  
>  static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);
>  
> +static const struct of_device_id stmpe_adc_ids[] = {
> +	{ .compatible = "st,stmpe-adc", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> +
>  static struct platform_driver stmpe_adc_driver = {
>  	.probe		= stmpe_adc_probe,
>  	.driver		= {
>  		.name	= "stmpe-adc",
>  		.pm	= &stmpe_adc_pm_ops,
> +		.of_match_table = stmpe_adc_ids,
>  	},
>  };
>  module_platform_driver(stmpe_adc_driver);
>  
> -static const struct of_device_id stmpe_adc_ids[] = {
> -	{ .compatible = "st,stmpe-adc", },
> -	{ },
> -};
> -MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> -
>  MODULE_AUTHOR("Stefan Agner <stefan.agner@toradex.com>");
>  MODULE_DESCRIPTION("STMPEXXX ADC driver");
>  MODULE_LICENSE("GPL v2");


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-01 17:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-01 10:34 [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching Krzysztof Kozlowski
2022-05-01 10:34 ` Krzysztof Kozlowski
2022-05-01 10:34 ` [PATCH 2/2] iio: ti-ads8688: " Krzysztof Kozlowski
2022-05-01 10:34   ` Krzysztof Kozlowski
2022-05-01 18:00 ` [PATCH 1/2] iio: stmpe-adc: " Jonathan Cameron
2022-05-01 18:00   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.