All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Stephan Gerhold <stephan@gerhold.net>,
	linux-usb@vger.kernel.org, linux-phy@lists.infradead.org
Subject: [PATCH v2 3/9] usb: dwc3: pci: Set the swnode from inside dwc3_pci_quirks()
Date: Sun, 13 Feb 2022 14:05:18 +0100	[thread overview]
Message-ID: <20220213130524.18748-4-hdegoede@redhat.com> (raw)
In-Reply-To: <20220213130524.18748-1-hdegoede@redhat.com>

The quirk handling may need to set some different properties
which means using a different swnode, move the setting of the swnode
to inside dwc3_pci_quirks() so that the quirk handling can choose
a different swnode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/usb/dwc3/dwc3-pci.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 1ecedbb1684c..40a3a1b114e9 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -184,7 +184,8 @@ static const struct software_node dwc3_pci_amd_mr_swnode = {
 	.properties = dwc3_pci_mr_properties,
 };
 
-static int dwc3_pci_quirks(struct dwc3_pci *dwc)
+static int dwc3_pci_quirks(struct dwc3_pci *dwc,
+			   const struct software_node *swnode)
 {
 	struct pci_dev			*pdev = dwc->pci;
 
@@ -241,7 +242,7 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
 		}
 	}
 
-	return 0;
+	return device_add_software_node(&dwc->dwc3->dev, swnode);
 }
 
 #ifdef CONFIG_PM
@@ -306,11 +307,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
 	dwc->dwc3->dev.parent = dev;
 	ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev));
 
-	ret = device_add_software_node(&dwc->dwc3->dev, (void *)id->driver_data);
-	if (ret < 0)
-		goto err;
-
-	ret = dwc3_pci_quirks(dwc);
+	ret = dwc3_pci_quirks(dwc, (void *)id->driver_data);
 	if (ret)
 		goto err;
 
-- 
2.33.1


WARNING: multiple messages have this Message-ID (diff)
From: Hans de Goede <hdegoede@redhat.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Stephan Gerhold <stephan@gerhold.net>,
	linux-usb@vger.kernel.org, linux-phy@lists.infradead.org
Subject: [PATCH v2 3/9] usb: dwc3: pci: Set the swnode from inside dwc3_pci_quirks()
Date: Sun, 13 Feb 2022 14:05:18 +0100	[thread overview]
Message-ID: <20220213130524.18748-4-hdegoede@redhat.com> (raw)
In-Reply-To: <20220213130524.18748-1-hdegoede@redhat.com>

The quirk handling may need to set some different properties
which means using a different swnode, move the setting of the swnode
to inside dwc3_pci_quirks() so that the quirk handling can choose
a different swnode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/usb/dwc3/dwc3-pci.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 1ecedbb1684c..40a3a1b114e9 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -184,7 +184,8 @@ static const struct software_node dwc3_pci_amd_mr_swnode = {
 	.properties = dwc3_pci_mr_properties,
 };
 
-static int dwc3_pci_quirks(struct dwc3_pci *dwc)
+static int dwc3_pci_quirks(struct dwc3_pci *dwc,
+			   const struct software_node *swnode)
 {
 	struct pci_dev			*pdev = dwc->pci;
 
@@ -241,7 +242,7 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
 		}
 	}
 
-	return 0;
+	return device_add_software_node(&dwc->dwc3->dev, swnode);
 }
 
 #ifdef CONFIG_PM
@@ -306,11 +307,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
 	dwc->dwc3->dev.parent = dev;
 	ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev));
 
-	ret = device_add_software_node(&dwc->dwc3->dev, (void *)id->driver_data);
-	if (ret < 0)
-		goto err;
-
-	ret = dwc3_pci_quirks(dwc);
+	ret = dwc3_pci_quirks(dwc, (void *)id->driver_data);
 	if (ret)
 		goto err;
 
-- 
2.33.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  parent reply	other threads:[~2022-02-13 13:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-13 13:05 [PATCH v2 0/9] usb/dwc3 / phy/tusb1210: Add TUSB1211 charger detection Hans de Goede
2022-02-13 13:05 ` Hans de Goede
2022-02-13 13:05 ` [PATCH v2 1/9] usb: dwc3: pci: Add "snps,dis_u2_susphy_quirk" for Intel Bay Trail Hans de Goede
2022-02-13 13:05   ` [PATCH v2 1/9] usb: dwc3: pci: Add "snps, dis_u2_susphy_quirk" " Hans de Goede
2022-02-13 13:05 ` [PATCH v2 2/9] usb: dwc3: pci: Fix Bay Trail phy GPIO mappings Hans de Goede
2022-02-13 13:05   ` Hans de Goede
2022-02-13 13:05 ` Hans de Goede [this message]
2022-02-13 13:05   ` [PATCH v2 3/9] usb: dwc3: pci: Set the swnode from inside dwc3_pci_quirks() Hans de Goede
2022-02-13 13:05 ` [PATCH v2 4/9] usb: dwc3: pci: Set "linux,phy_charger_detect" property on some Bay Trail boards Hans de Goede
2022-02-13 13:05   ` [PATCH v2 4/9] usb: dwc3: pci: Set "linux, phy_charger_detect" " Hans de Goede
2022-02-13 13:05 ` [PATCH v2 5/9] usb: dwc3: pci: Also apply Bay Trail GPIO mappings to ulpi-device Hans de Goede
2022-02-13 13:05   ` Hans de Goede
2022-02-13 13:05 ` [PATCH v2 6/9] phy: ti: tusb1210: Improve ulpi_read()/_write() error checking Hans de Goede
2022-02-13 13:05   ` Hans de Goede
2022-02-13 13:05 ` [PATCH v2 7/9] phy: ti: tusb1210: Drop tusb->vendor_specific2 != 0 check from tusb1210_power_on() Hans de Goede
2022-02-13 13:05   ` Hans de Goede
2022-02-13 13:05 ` [PATCH v2 8/9] phy: ti: tusb1210: Add a delay between power-on and restoring the phy-parameters Hans de Goede
2022-02-13 13:05   ` Hans de Goede
2022-02-13 13:05 ` [PATCH v2 9/9] phy: ti: tusb1210: Add charger detection Hans de Goede
2022-02-13 13:05   ` Hans de Goede
2022-02-17 15:31 ` [PATCH v2 0/9] usb/dwc3 / phy/tusb1210: Add TUSB1211 " Greg Kroah-Hartman
2022-02-17 15:31   ` Greg Kroah-Hartman
2022-02-25  8:58 ` Vinod Koul
2022-02-25  8:58   ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220213130524.18748-4-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stephan@gerhold.net \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.