diff mbox series

[v2,2/2] hwmon: tmp512: drop of_match_ptr for ID table

Message ID 20230312193723.478032-2-krzysztof.kozlowski@linaro.org (mailing list archive)
State Accepted
Headers show
Series [v2,1/2] hwmon: gpio-fan: drop of_match_ptr for ID table | expand

Commit Message

Krzysztof Kozlowski March 12, 2023, 7:37 p.m. UTC
The driver will match mostly by DT table (even thought there is regular
ID table) so there is little benefit in of_match_ptr (this also allows
ACPI matching via PRP0001, even though it might not be relevant here).
This also fixes !CONFIG_OF error:

  drivers/hwmon/tmp513.c:610:34: error: ‘tmp51x_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. Rework patch and commit msg - drop of_match_ptr.
---
 drivers/hwmon/tmp513.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck March 12, 2023, 9:14 p.m. UTC | #1
On Sun, Mar 12, 2023 at 08:37:23PM +0100, Krzysztof Kozlowski wrote:
> The driver will match mostly by DT table (even thought there is regular
> ID table) so there is little benefit in of_match_ptr (this also allows
> ACPI matching via PRP0001, even though it might not be relevant here).
> This also fixes !CONFIG_OF error:
> 
>   drivers/hwmon/tmp513.c:610:34: error: ‘tmp51x_of_match’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Applied.

Thanks,
Guenter

> ---
> 
> Changes since v1:
> 1. Rework patch and commit msg - drop of_match_ptr.
> ---
>  drivers/hwmon/tmp513.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
> index 47bbe47e062f..7d5f7441aceb 100644
> --- a/drivers/hwmon/tmp513.c
> +++ b/drivers/hwmon/tmp513.c
> @@ -758,7 +758,7 @@ static int tmp51x_probe(struct i2c_client *client)
>  static struct i2c_driver tmp51x_driver = {
>  	.driver = {
>  		.name	= "tmp51x",
> -		.of_match_table = of_match_ptr(tmp51x_of_match),
> +		.of_match_table = tmp51x_of_match,
>  	},
>  	.probe_new	= tmp51x_probe,
>  	.id_table	= tmp51x_id,
diff mbox series

Patch

diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index 47bbe47e062f..7d5f7441aceb 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -758,7 +758,7 @@  static int tmp51x_probe(struct i2c_client *client)
 static struct i2c_driver tmp51x_driver = {
 	.driver = {
 		.name	= "tmp51x",
-		.of_match_table = of_match_ptr(tmp51x_of_match),
+		.of_match_table = tmp51x_of_match,
 	},
 	.probe_new	= tmp51x_probe,
 	.id_table	= tmp51x_id,