Skip to contentSkip to conversation

usb: chipidea: Fix unused ci_hdrc_usb2_of_match warning for !CONFIG_OF

PATCH In review Rob Herring 2 participants 2 messages Oct 19, 2023 – Oct 20, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: chipidea: Fix unused ci_hdrc_usb2_of_match warning for !CONFIG_OF

Commit 14485de431b0 ("usb: Use device_get_match_data()") dropped the unconditional use of ci_hdrc_usb2_of_match resulting in this warning:

drivers/usb/chipidea/ci_hdrc_usb2.c:41:34: warning: unused variable 'ci_hdrc_usb2_of_match' [-Wunused-const-variable]

The fix is to drop of_match_ptr() which is not necessary because DT is always used for this driver.

---
 drivers/usb/chipidea/ci_hdrc_usb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/ci_hdrc_usb2.c +1 -1
index 180a632dd7ba..97379f653b06 100644
@@ -119,7 +119,7 @@ static struct platform_driver ci_hdrc_usb2_driver = {
 	.remove_new = ci_hdrc_usb2_remove,
 	.driver	= {
 		.name		= "chipidea-usb2",
-		.of_match_table	= of_match_ptr(ci_hdrc_usb2_of_match),
+		.of_match_table	= ci_hdrc_usb2_of_match,
 	},
 };
 module_platform_driver(ci_hdrc_usb2_driver);
Signature · 1 line
2.42.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rob Herring

Commit 14485de431b0 ("usb: Use device_get_match_data()") dropped the unconditional use of ci_hdrc_usb2_of_match resulting in this warning:

drivers/usb/chipidea/ci_hdrc_usb2.c:41:34: warning: unused variable 'ci_hdrc_usb2_of_match' [-Wunused-const-variable]

Quoted 7 lines

The fix is to drop of_match_ptr() which is not necessary because DT is always used for this driver.

Quoted 20 lines
---
 drivers/usb/chipidea/ci_hdrc_usb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/ci_hdrc_usb2.c +1 -1
index 180a632dd7ba..97379f653b06 100644
@@ -119,7 +119,7 @@ static struct platform_driver ci_hdrc_usb2_driver = {
 	.remove_new = ci_hdrc_usb2_remove,
 	.driver	= {
 		.name		= "chipidea-usb2",
-		.of_match_table	= of_match_ptr(ci_hdrc_usb2_of_match),
+		.of_match_table	= ci_hdrc_usb2_of_match,
 	},
 };
 module_platform_driver(ci_hdrc_usb2_driver);
Signature · 1 line
2.42.0
Signature · 2 lines
Thanks,
Peter Chen