diff mbox series

Revert "usb: dwc3: qcom: Constify the software node"

Message ID 20210311090049.7354-1-shawn.guo@linaro.org
State New
Headers show
Series Revert "usb: dwc3: qcom: Constify the software node" | expand

Commit Message

Shawn Guo March 11, 2021, 9 a.m. UTC
This reverts commit 8dc6e6dd1bee39cd65a232a17d51240fc65a0f4a.

The commit causes an regression for ACPI probe on Lenovo Yoga C630
laptop.  platform_device_add_properties() will fail with -EEXIST for the
second USB instance, because of the software_node_to_swnode() check in
function software_node_register().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

---
 drivers/usb/dwc3/dwc3-qcom.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

-- 
2.17.1

Comments

Heikki Krogerus March 11, 2021, 9:11 a.m. UTC | #1
On Thu, Mar 11, 2021 at 05:00:49PM +0800, Shawn Guo wrote:
> This reverts commit 8dc6e6dd1bee39cd65a232a17d51240fc65a0f4a.
> 
> The commit causes an regression for ACPI probe on Lenovo Yoga C630
> laptop.  platform_device_add_properties() will fail with -EEXIST for the
> second USB instance, because of the software_node_to_swnode() check in
> function software_node_register().

I think you mean device_add_software_node() fails with -EEXIST, no?

There should be already a fix for that:
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=2a92c90f2ecca4475d6050f2f93
+8a1755a8954cc


thanks,
Shawn Guo March 11, 2021, 9:54 a.m. UTC | #2
On Thu, Mar 11, 2021 at 11:11:43AM +0200, Heikki Krogerus wrote:
> On Thu, Mar 11, 2021 at 05:00:49PM +0800, Shawn Guo wrote:
> > This reverts commit 8dc6e6dd1bee39cd65a232a17d51240fc65a0f4a.
> > 
> > The commit causes an regression for ACPI probe on Lenovo Yoga C630
> > laptop.  platform_device_add_properties() will fail with -EEXIST for the
> > second USB instance, because of the software_node_to_swnode() check in
> > function software_node_register().
> 
> I think you mean device_add_software_node() fails with -EEXIST, no?

Yeah, I was looking at the wrong line.

> 
> There should be already a fix for that:
> https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=2a92c90f2ecca4475d6050f2f93
> +8a1755a8954cc

Cool!  It fixes my problem.  Hope it will land 5.12-rc soon.

Shawn
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 0c11e45bccaf..7dc74885a635 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -570,10 +570,6 @@  static const struct property_entry dwc3_qcom_acpi_properties[] = {
 	{}
 };
 
-static const struct software_node dwc3_qcom_swnode = {
-	.properties = dwc3_qcom_acpi_properties,
-};
-
 static int dwc3_qcom_acpi_register_core(struct platform_device *pdev)
 {
 	struct dwc3_qcom	*qcom = platform_get_drvdata(pdev);
@@ -620,17 +616,16 @@  static int dwc3_qcom_acpi_register_core(struct platform_device *pdev)
 		goto out;
 	}
 
-	ret = device_add_software_node(&qcom->dwc3->dev, &dwc3_qcom_swnode);
+	ret = platform_device_add_properties(qcom->dwc3,
+					     dwc3_qcom_acpi_properties);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to add properties\n");
 		goto out;
 	}
 
 	ret = platform_device_add(qcom->dwc3);
-	if (ret) {
+	if (ret)
 		dev_err(&pdev->dev, "failed to add device\n");
-		device_remove_software_node(&qcom->dwc3->dev);
-	}
 
 out:
 	kfree(child_res);
@@ -845,7 +840,6 @@  static int dwc3_qcom_remove(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	int i;
 
-	device_remove_software_node(&qcom->dwc3->dev);
 	of_platform_depopulate(dev);
 
 	for (i = qcom->num_clocks - 1; i >= 0; i--) {