* [PATCH v2 1/2] hwmon: gpio-fan: drop of_match_ptr for ID table
@ 2023-03-12 19:37 Krzysztof Kozlowski
2023-03-12 19:37 ` [PATCH v2 2/2] hwmon: tmp512: " Krzysztof Kozlowski
2023-03-12 21:12 ` [PATCH v2 1/2] hwmon: gpio-fan: " Guenter Roeck
0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-12 19:37 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
Cc: Krzysztof Kozlowski
The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here). This
also fixes !CONFIG_OF error:
drivers/hwmon/gpio-fan.c:484:34: error: ‘of_gpio_fan_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/gpio-fan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index e75db6f64e8c..d92c536be9af 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -586,7 +586,7 @@ static struct platform_driver gpio_fan_driver = {
.driver = {
.name = "gpio-fan",
.pm = pm_sleep_ptr(&gpio_fan_pm),
- .of_match_table = of_match_ptr(of_gpio_fan_match),
+ .of_match_table = of_gpio_fan_match,
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] hwmon: tmp512: drop of_match_ptr for ID table
2023-03-12 19:37 [PATCH v2 1/2] hwmon: gpio-fan: drop of_match_ptr for ID table Krzysztof Kozlowski
@ 2023-03-12 19:37 ` Krzysztof Kozlowski
2023-03-12 21:14 ` Guenter Roeck
2023-03-12 21:12 ` [PATCH v2 1/2] hwmon: gpio-fan: " Guenter Roeck
1 sibling, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-12 19:37 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
Cc: Krzysztof Kozlowski
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(-)
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,
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/2] hwmon: gpio-fan: drop of_match_ptr for ID table
2023-03-12 19:37 [PATCH v2 1/2] hwmon: gpio-fan: drop of_match_ptr for ID table Krzysztof Kozlowski
2023-03-12 19:37 ` [PATCH v2 2/2] hwmon: tmp512: " Krzysztof Kozlowski
@ 2023-03-12 21:12 ` Guenter Roeck
1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2023-03-12 21:12 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Jean Delvare, Eric Tremblay, linux-hwmon, linux-kernel
On Sun, Mar 12, 2023 at 08:37:22PM +0100, Krzysztof Kozlowski wrote:
> The driver can match only via the DT table so the table should be always
> used and the of_match_ptr does not have any sense (this also allows ACPI
> matching via PRP0001, even though it might not be relevant here). This
> also fixes !CONFIG_OF error:
>
> drivers/hwmon/gpio-fan.c:484:34: error: ‘of_gpio_fan_match’ defined but not used [-Werror=unused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied, though I added a note describing that the above build error can
only be seen if the OF -> GPIO_OF dependency is broken.
Thanks,
Guenter
> ---
>
> Changes since v1:
> 1. Rework patch and commit msg - drop of_match_ptr.
> ---
> drivers/hwmon/gpio-fan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index e75db6f64e8c..d92c536be9af 100644
> --- a/drivers/hwmon/gpio-fan.c
> +++ b/drivers/hwmon/gpio-fan.c
> @@ -586,7 +586,7 @@ static struct platform_driver gpio_fan_driver = {
> .driver = {
> .name = "gpio-fan",
> .pm = pm_sleep_ptr(&gpio_fan_pm),
> - .of_match_table = of_match_ptr(of_gpio_fan_match),
> + .of_match_table = of_gpio_fan_match,
> },
> };
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] hwmon: tmp512: drop of_match_ptr for ID table
2023-03-12 19:37 ` [PATCH v2 2/2] hwmon: tmp512: " Krzysztof Kozlowski
@ 2023-03-12 21:14 ` Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2023-03-12 21:14 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Jean Delvare, Eric Tremblay, linux-hwmon, linux-kernel
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,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-12 21:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-12 19:37 [PATCH v2 1/2] hwmon: gpio-fan: drop of_match_ptr for ID table Krzysztof Kozlowski
2023-03-12 19:37 ` [PATCH v2 2/2] hwmon: tmp512: " Krzysztof Kozlowski
2023-03-12 21:14 ` Guenter Roeck
2023-03-12 21:12 ` [PATCH v2 1/2] hwmon: gpio-fan: " Guenter Roeck
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.