2023-03-11 17:37:58

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/7] usb: host: xhci-rcar: drop of_match_ptr for ID table

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/usb/host/xhci-rcar.c:269:34: error: ‘usb_xhci_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/usb/host/xhci-rcar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c
index 7f18509a1d39..b12c2c19d107 100644
--- a/drivers/usb/host/xhci-rcar.c
+++ b/drivers/usb/host/xhci-rcar.c
@@ -312,7 +312,7 @@ static struct platform_driver usb_xhci_renesas_driver = {
.driver = {
.name = "xhci-renesas-hcd",
.pm = &xhci_plat_pm_ops,
- .of_match_table = of_match_ptr(usb_xhci_of_match),
+ .of_match_table = usb_xhci_of_match,
},
};
module_platform_driver(usb_xhci_renesas_driver);
--
2.34.1



2023-03-11 17:38:06

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 5/7] usb: gadget: renesas_usb3: drop of_match_ptr for ID table

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/usb/gadget/udc/renesas_usb3.c:2811:34: error: ‘usb3_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index bee6bceafc4f..24ff3bce68df 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -3039,7 +3039,7 @@ static struct platform_driver renesas_usb3_driver = {
.driver = {
.name = udc_name,
.pm = &renesas_usb3_pm_ops,
- .of_match_table = of_match_ptr(usb3_of_match),
+ .of_match_table = usb3_of_match,
},
};
module_platform_driver(renesas_usb3_driver);
--
2.34.1


2023-03-11 17:38:09

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 6/7] usb: gadget: max3420_udc: drop of_match_ptr for ID table

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/usb/gadget/udc/max3420_udc.c:1312:34: error: ‘max3420_udc_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/usb/gadget/udc/max3420_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/max3420_udc.c b/drivers/usb/gadget/udc/max3420_udc.c
index ddf0ed3eb4f2..12c519f32bf7 100644
--- a/drivers/usb/gadget/udc/max3420_udc.c
+++ b/drivers/usb/gadget/udc/max3420_udc.c
@@ -1319,7 +1319,7 @@ MODULE_DEVICE_TABLE(of, max3420_udc_of_match);
static struct spi_driver max3420_driver = {
.driver = {
.name = "max3420-udc",
- .of_match_table = of_match_ptr(max3420_udc_of_match),
+ .of_match_table = max3420_udc_of_match,
},
.probe = max3420_probe,
.remove = max3420_remove,
--
2.34.1


2023-03-11 17:38:12

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 2/7] usb: host: max3421-hcd: drop of_match_ptr for ID table

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/usb/host/max3421-hcd.c:1943:34: error: ‘max3421_of_match_table’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/usb/host/max3421-hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 28d1524ee2fa..d152d72de126 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1951,7 +1951,7 @@ static struct spi_driver max3421_driver = {
.remove = max3421_remove,
.driver = {
.name = "max3421-hcd",
- .of_match_table = of_match_ptr(max3421_of_match_table),
+ .of_match_table = max3421_of_match_table,
},
};

--
2.34.1


2023-03-11 17:38:17

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 3/7] usb: renesas_usbhs: drop of_match_ptr for ID table

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/usb/renesas_usbhs/common.c:535:34: error: ‘usbhs_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/usb/renesas_usbhs/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 96f3939a65e2..fa34efabcccf 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -823,7 +823,7 @@ static struct platform_driver renesas_usbhs_driver = {
.driver = {
.name = "renesas_usbhs",
.pm = &usbhsc_pm_ops,
- .of_match_table = of_match_ptr(usbhs_of_match),
+ .of_match_table = usbhs_of_match,
},
.probe = usbhs_probe,
.remove = usbhs_remove,
--
2.34.1


2023-03-11 17:38:23

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 4/7] usb: gadget: rzv2m_usb3drd: drop of_match_ptr for ID table

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/usb/gadget/udc/rzv2m_usb3drd.c:120:34: error: ‘rzv2m_usb3drd_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/usb/gadget/udc/rzv2m_usb3drd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/rzv2m_usb3drd.c b/drivers/usb/gadget/udc/rzv2m_usb3drd.c
index 3c8bbf843038..8855d8e8d793 100644
--- a/drivers/usb/gadget/udc/rzv2m_usb3drd.c
+++ b/drivers/usb/gadget/udc/rzv2m_usb3drd.c
@@ -126,7 +126,7 @@ MODULE_DEVICE_TABLE(of, rzv2m_usb3drd_of_match);
static struct platform_driver rzv2m_usb3drd_driver = {
.driver = {
.name = "rzv2m-usb3drd",
- .of_match_table = of_match_ptr(rzv2m_usb3drd_of_match),
+ .of_match_table = rzv2m_usb3drd_of_match,
},
.probe = rzv2m_usb3drd_probe,
.remove = rzv2m_usb3drd_remove,
--
2.34.1


2023-03-11 17:38:27

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 7/7] usb: misc: usb251xb: drop of_match_ptr for ID table

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).

drivers/usb/misc/usb251xb.c:223:35: error: ‘usb2517i_data’ defined but not used [-Werror=unused-const-variable=]
drivers/usb/misc/usb251xb.c:215:35: error: ‘usb2517_data’ defined but not used [-Werror=unused-const-variable=]
drivers/usb/misc/usb251xb.c:207:35: error: ‘usb2514bi_data’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/usb/misc/usb251xb.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
index e3abe67a155d..c36e04aa5a82 100644
--- a/drivers/usb/misc/usb251xb.c
+++ b/drivers/usb/misc/usb251xb.c
@@ -377,7 +377,6 @@ static int usb251xb_connect(struct usb251xb *hub)
return err;
}

-#ifdef CONFIG_OF
static void usb251xb_get_ports_field(struct usb251xb *hub,
const char *prop_name, u8 port_cnt,
bool ds_only, u8 *fld)
@@ -626,13 +625,6 @@ static const struct of_device_id usb251xb_of_match[] = {
}
};
MODULE_DEVICE_TABLE(of, usb251xb_of_match);
-#else /* CONFIG_OF */
-static int usb251xb_get_ofdata(struct usb251xb *hub,
- const struct usb251xb_data *data)
-{
- return 0;
-}
-#endif /* CONFIG_OF */

static void usb251xb_regulator_disable_action(void *data)
{
@@ -754,7 +746,7 @@ MODULE_DEVICE_TABLE(i2c, usb251xb_id);
static struct i2c_driver usb251xb_i2c_driver = {
.driver = {
.name = DRIVER_NAME,
- .of_match_table = of_match_ptr(usb251xb_of_match),
+ .of_match_table = usb251xb_of_match,
.pm = &usb251xb_pm_ops,
},
.probe_new = usb251xb_i2c_probe,
--
2.34.1


2023-03-13 07:43:34

by Richard Leitner

[permalink] [raw]
Subject: Re: [PATCH 7/7] usb: misc: usb251xb: drop of_match_ptr for ID table

On Sat, Mar 11, 2023 at 06:36:24PM +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).
>
> drivers/usb/misc/usb251xb.c:223:35: error: ‘usb2517i_data’ defined but not used [-Werror=unused-const-variable=]
> drivers/usb/misc/usb251xb.c:215:35: error: ‘usb2517_data’ defined but not used [-Werror=unused-const-variable=]
> drivers/usb/misc/usb251xb.c:207:35: error: ‘usb2514bi_data’ defined but not used [-Werror=unused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Thanks.

Acked-by: Richard Leitner <[email protected]>

regards;rl