diff mbox series

[05/12] net: dsa: ocelot: drop of_match_ptr for ID table

Message ID 20230311173303.262618-5-krzysztof.kozlowski@linaro.org (mailing list archive)
State Handled Elsewhere
Headers show
Series [01/12] net: dsa: lantiq_gswip: mark OF related data as maybe unused | expand

Commit Message

Krzysztof Kozlowski March 11, 2023, 5:32 p.m. UTC
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).

  drivers/net/dsa/ocelot/ocelot_ext.c:143:34: error: ‘ocelot_ext_switch_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/dsa/ocelot/ocelot_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Foster March 14, 2023, 3:34 p.m. UTC | #1
On Sat, Mar 11, 2023 at 06:32:56PM +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).
> 
>   drivers/net/dsa/ocelot/ocelot_ext.c:143:34: error: ‘ocelot_ext_switch_of_match’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/net/dsa/ocelot/ocelot_ext.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dsa/ocelot/ocelot_ext.c b/drivers/net/dsa/ocelot/ocelot_ext.c
> index 063150659816..228737a32080 100644
> --- a/drivers/net/dsa/ocelot/ocelot_ext.c
> +++ b/drivers/net/dsa/ocelot/ocelot_ext.c
> @@ -149,7 +149,7 @@ MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match);
>  static struct platform_driver ocelot_ext_switch_driver = {
>  	.driver = {
>  		.name = "ocelot-ext-switch",
> -		.of_match_table = of_match_ptr(ocelot_ext_switch_of_match),
> +		.of_match_table = ocelot_ext_switch_of_match,
>  	},
>  	.probe = ocelot_ext_probe,
>  	.remove = ocelot_ext_remove,
> -- 
> 2.34.1
> 

Acked-by: Colin Foster <colin.foster@in-advantage.com>
diff mbox series

Patch

diff --git a/drivers/net/dsa/ocelot/ocelot_ext.c b/drivers/net/dsa/ocelot/ocelot_ext.c
index 063150659816..228737a32080 100644
--- a/drivers/net/dsa/ocelot/ocelot_ext.c
+++ b/drivers/net/dsa/ocelot/ocelot_ext.c
@@ -149,7 +149,7 @@  MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match);
 static struct platform_driver ocelot_ext_switch_driver = {
 	.driver = {
 		.name = "ocelot-ext-switch",
-		.of_match_table = of_match_ptr(ocelot_ext_switch_of_match),
+		.of_match_table = ocelot_ext_switch_of_match,
 	},
 	.probe = ocelot_ext_probe,
 	.remove = ocelot_ext_remove,