Skip to contentSkip to conversation

usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()

PATCH In review pip-izony 2 participants 6 messages Jun 17, 2025 – Jun 19, 2025

Subsystems (2)
lore
Share & tools
lore

pip-izony

author
#0 lore raw

PATCH 1/1 usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()

The variable of_match was incorrectly declared as a bool. It is assigned the return value of of_match_device(), which is a pointer of type const struct of_device_id *.

---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index 6dab142e7278..49eb874b1d81 100644
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 5 lines · pip-izony

The variable of_match was incorrectly declared as a bool. It is assigned the return value of of_match_device(), which is a pointer of type const struct of_device_id *.

We need a real name here, please.

Also, what commit id does this fix?

And finally, how is this even building if the type is wrong?

confused,

greg k-h

#2 lore raw

PATCH 1/1 usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()

From: pip-izony <[email protected]>

The variable of_match was incorrectly declared as a bool. It is assigned the return value of of_match_device(), which is a pointer of type const struct of_device_id *.

Fixes 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")
---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index 6dab142e7278..49eb874b1d81 100644
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
Signature · 17 lines
2.43.0

Hello Greg,

Thank you for your review and the helpful feedback.

I've corrected Signed-off-by line to use my real name.
I also updated Fixes tag in the commit.

Regarding the original issue:
I'm not exactly sure why the compiler didn't catch this,
but I assume implicit casting from pointer to bool is allowed in this context.

Thank you for your email!

Best regards,
Seungjin Bae
#3 lore raw
Quoted 1 line · Seungjin Bae

From: pip-izony <[email protected]>

This line doesn't match up with:

Quoted 8 lines

The variable of_match was incorrectly declared as a bool. It is assigned the return value of of_match_device(), which is a pointer of type const struct of_device_id *.

Fixes 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")

That line :(

Also, no need for a blank line after Fixes:

Also:

Quoted 30 lines
---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index 6dab142e7278..49eb874b1d81 100644
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
Signature · 12 lines
2.43.0

Hello Greg,

Thank you for your review and the helpful feedback.

I've corrected Signed-off-by line to use my real name.
I also updated Fixes tag in the commit.

Regarding the original issue:
I'm not exactly sure why the compiler didn't catch this,
but I assume implicit casting from pointer to bool is allowed in this context.

That info should go below the --- line, and this is a version 2 of this change, right? Take a look at the kernel documentation for how to number your patch revisions.

thanks,

greg k-h

#4 lore raw

PATCH v3 1/1 usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()

The variable of_match was incorrectly declared as a bool. It is assigned the return value of of_match_device(), which is a pointer of type const struct of_device_id *.

Fixes 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")

---
v2 -> v3: Added version of patch and used real name v1 -> v2: Updated Fixes tag and corrected Signed-off-by line

 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index 6dab142e7278..49eb874b1d81 100644
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
Signature · 1 line
2.43.0
#5 lore raw

PATCH v4 1/1 usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()

In reply to Greg Kroah-Hartman

The variable of_match was incorrectly declared as a bool. It is assigned the return value of of_match_device(), which is a pointer of type const struct of_device_id *.

Fixes 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")

---
v3 -> v4: Corrected a typo in the changelog
v2 -> v3: Added version of patch and used real name v1 -> v2: Updated Fixes tag and corrected Signed-off-by line

 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index 6dab142e7278..49eb874b1d81 100644
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
Signature · 1 line
2.43.0