diff mbox series

[3/3] hwmon: (ntc_thermistor): Move DT matches to the driver block

Message ID 20211205235948.4167075-3-linus.walleij@linaro.org (mailing list archive)
State Accepted
Headers show
Series [1/3] hwmon: (ntc_thermistor): Inline OF data lookup in probe() | expand

Commit Message

Linus Walleij Dec. 5, 2021, 11:59 p.m. UTC
This moves the device tree match data toward the end of the
driver which is the convention, here we can also add ACPI
and similar match data in a conforming manner.

Cc: Peter Rosin <peda@axentia.se>
Cc: Chris Lesiak <chris.lesiak@licor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/hwmon/ntc_thermistor.c | 70 +++++++++++++++++-----------------
 1 file changed, 35 insertions(+), 35 deletions(-)

Comments

Guenter Roeck Dec. 7, 2021, 5:33 p.m. UTC | #1
On Mon, Dec 06, 2021 at 12:59:48AM +0100, Linus Walleij wrote:
> This moves the device tree match data toward the end of the
> driver which is the convention, here we can also add ACPI
> and similar match data in a conforming manner.
> 
> Cc: Peter Rosin <peda@axentia.se>
> Cc: Chris Lesiak <chris.lesiak@licor.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/ntc_thermistor.c | 70 +++++++++++++++++-----------------
>  1 file changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
> index 246e109db462..a3588ec12ca5 100644
> --- a/drivers/hwmon/ntc_thermistor.c
> +++ b/drivers/hwmon/ntc_thermistor.c
> @@ -368,41 +368,6 @@ static int ntc_adc_iio_read(struct ntc_data *data)
>  	return uv;
>  }
>  
> -static const struct of_device_id ntc_match[] = {
> -	{ .compatible = "epcos,b57330v2103",
> -		.data = &ntc_thermistor_id[NTC_B57330V2103]},
> -	{ .compatible = "epcos,b57891s0103",
> -		.data = &ntc_thermistor_id[NTC_B57891S0103] },
> -	{ .compatible = "murata,ncp03wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
> -	{ .compatible = "murata,ncp03wf104",
> -		.data = &ntc_thermistor_id[NTC_NCP03WF104] },
> -	{ .compatible = "murata,ncp15wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
> -	{ .compatible = "murata,ncp15wl333",
> -		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
> -	{ .compatible = "murata,ncp15xh103",
> -		.data = &ntc_thermistor_id[NTC_NCP15XH103] },
> -	{ .compatible = "murata,ncp18wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
> -	{ .compatible = "murata,ncp21wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
> -
> -	/* Usage of vendor name "ntc" is deprecated */
> -	{ .compatible = "ntc,ncp03wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
> -	{ .compatible = "ntc,ncp15wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
> -	{ .compatible = "ntc,ncp15wl333",
> -		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
> -	{ .compatible = "ntc,ncp18wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
> -	{ .compatible = "ntc,ncp21wb473",
> -		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
> -	{ },
> -};
> -MODULE_DEVICE_TABLE(of, ntc_match);
> -
>  static inline u64 div64_u64_safe(u64 dividend, u64 divisor)
>  {
>  	if (divisor == 0 && dividend == 0)
> @@ -671,6 +636,41 @@ static int ntc_thermistor_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct of_device_id ntc_match[] = {
> +	{ .compatible = "epcos,b57330v2103",
> +		.data = &ntc_thermistor_id[NTC_B57330V2103]},
> +	{ .compatible = "epcos,b57891s0103",
> +		.data = &ntc_thermistor_id[NTC_B57891S0103] },
> +	{ .compatible = "murata,ncp03wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
> +	{ .compatible = "murata,ncp03wf104",
> +		.data = &ntc_thermistor_id[NTC_NCP03WF104] },
> +	{ .compatible = "murata,ncp15wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
> +	{ .compatible = "murata,ncp15wl333",
> +		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
> +	{ .compatible = "murata,ncp15xh103",
> +		.data = &ntc_thermistor_id[NTC_NCP15XH103] },
> +	{ .compatible = "murata,ncp18wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
> +	{ .compatible = "murata,ncp21wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
> +
> +	/* Usage of vendor name "ntc" is deprecated */
> +	{ .compatible = "ntc,ncp03wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
> +	{ .compatible = "ntc,ncp15wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
> +	{ .compatible = "ntc,ncp15wl333",
> +		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
> +	{ .compatible = "ntc,ncp18wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
> +	{ .compatible = "ntc,ncp21wb473",
> +		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, ntc_match);
> +
>  static struct platform_driver ntc_thermistor_driver = {
>  	.driver = {
>  		.name = "ntc-thermistor",
diff mbox series

Patch

diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
index 246e109db462..a3588ec12ca5 100644
--- a/drivers/hwmon/ntc_thermistor.c
+++ b/drivers/hwmon/ntc_thermistor.c
@@ -368,41 +368,6 @@  static int ntc_adc_iio_read(struct ntc_data *data)
 	return uv;
 }
 
-static const struct of_device_id ntc_match[] = {
-	{ .compatible = "epcos,b57330v2103",
-		.data = &ntc_thermistor_id[NTC_B57330V2103]},
-	{ .compatible = "epcos,b57891s0103",
-		.data = &ntc_thermistor_id[NTC_B57891S0103] },
-	{ .compatible = "murata,ncp03wb473",
-		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
-	{ .compatible = "murata,ncp03wf104",
-		.data = &ntc_thermistor_id[NTC_NCP03WF104] },
-	{ .compatible = "murata,ncp15wb473",
-		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
-	{ .compatible = "murata,ncp15wl333",
-		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
-	{ .compatible = "murata,ncp15xh103",
-		.data = &ntc_thermistor_id[NTC_NCP15XH103] },
-	{ .compatible = "murata,ncp18wb473",
-		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
-	{ .compatible = "murata,ncp21wb473",
-		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
-
-	/* Usage of vendor name "ntc" is deprecated */
-	{ .compatible = "ntc,ncp03wb473",
-		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
-	{ .compatible = "ntc,ncp15wb473",
-		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
-	{ .compatible = "ntc,ncp15wl333",
-		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
-	{ .compatible = "ntc,ncp18wb473",
-		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
-	{ .compatible = "ntc,ncp21wb473",
-		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, ntc_match);
-
 static inline u64 div64_u64_safe(u64 dividend, u64 divisor)
 {
 	if (divisor == 0 && dividend == 0)
@@ -671,6 +636,41 @@  static int ntc_thermistor_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ntc_match[] = {
+	{ .compatible = "epcos,b57330v2103",
+		.data = &ntc_thermistor_id[NTC_B57330V2103]},
+	{ .compatible = "epcos,b57891s0103",
+		.data = &ntc_thermistor_id[NTC_B57891S0103] },
+	{ .compatible = "murata,ncp03wb473",
+		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
+	{ .compatible = "murata,ncp03wf104",
+		.data = &ntc_thermistor_id[NTC_NCP03WF104] },
+	{ .compatible = "murata,ncp15wb473",
+		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
+	{ .compatible = "murata,ncp15wl333",
+		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
+	{ .compatible = "murata,ncp15xh103",
+		.data = &ntc_thermistor_id[NTC_NCP15XH103] },
+	{ .compatible = "murata,ncp18wb473",
+		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
+	{ .compatible = "murata,ncp21wb473",
+		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
+
+	/* Usage of vendor name "ntc" is deprecated */
+	{ .compatible = "ntc,ncp03wb473",
+		.data = &ntc_thermistor_id[NTC_NCP03WB473] },
+	{ .compatible = "ntc,ncp15wb473",
+		.data = &ntc_thermistor_id[NTC_NCP15WB473] },
+	{ .compatible = "ntc,ncp15wl333",
+		.data = &ntc_thermistor_id[NTC_NCP15WL333] },
+	{ .compatible = "ntc,ncp18wb473",
+		.data = &ntc_thermistor_id[NTC_NCP18WB473] },
+	{ .compatible = "ntc,ncp21wb473",
+		.data = &ntc_thermistor_id[NTC_NCP21WB473] },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, ntc_match);
+
 static struct platform_driver ntc_thermistor_driver = {
 	.driver = {
 		.name = "ntc-thermistor",