All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, chunfeng.yun@mediatek.com,
	matthias.bgg@gmail.com, linux@prisktech.co.nz,
	Peter.Chen@nxp.com
Cc: mathias.nyman@intel.com, stern@rowland.harvard.edu,
	gregkh@linuxfoundation.org,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Subject: [RFC/RFT,usb-next,v1,6/6] usb: core: hcd: remove support for initializing a single PHY
Date: Thu, 25 Jan 2018 01:16:39 +0100	[thread overview]
Message-ID: <20180125001639.14681-7-martin.blumenstingl@googlemail.com> (raw)

With the new PHY wrapper in place we can now handle multiple PHYs.
Remove the code which handles only one generic PHY as this is now
covered (with support for multiple PHYs as well as suspend/resume
support) by the new PHY wrapper.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/usb/core/hcd.c  | 37 -------------------------------------
 include/linux/usb/hcd.h |  1 -
 2 files changed, 38 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index fc99cddc117e..5d59e0b4d463 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2757,30 +2757,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
 		}
 	}
 
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
-		struct phy *phy = phy_get(hcd->self.sysdev, "usb");
-
-		if (IS_ERR(phy)) {
-			retval = PTR_ERR(phy);
-			if (retval == -EPROBE_DEFER)
-				goto err_phy;
-		} else {
-			retval = phy_init(phy);
-			if (retval) {
-				phy_put(phy);
-				goto err_phy;
-			}
-			retval = phy_power_on(phy);
-			if (retval) {
-				phy_exit(phy);
-				phy_put(phy);
-				goto err_phy;
-			}
-			hcd->phy = phy;
-			hcd->remove_phy = 1;
-		}
-	}
-
 	hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 	if (IS_ERR(hcd->phy_roothub)) {
 		retval = PTR_ERR(hcd->phy_roothub);
@@ -2959,13 +2935,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
 err_usb_phy_roothub_power_on:
 	usb_phy_roothub_exit(hcd->phy_roothub);
 err_phy_roothub_init:
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
-		phy_power_off(hcd->phy);
-		phy_exit(hcd->phy);
-		phy_put(hcd->phy);
-		hcd->phy = NULL;
-	}
-err_phy:
 	if (hcd->remove_phy && hcd->usb_phy) {
 		usb_phy_shutdown(hcd->usb_phy);
 		usb_put_phy(hcd->usb_phy);
@@ -3046,12 +3015,6 @@ void usb_remove_hcd(struct usb_hcd *hcd)
 	usb_phy_roothub_power_off(hcd->phy_roothub);
 	usb_phy_roothub_exit(hcd->phy_roothub);
 
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
-		phy_power_off(hcd->phy);
-		phy_exit(hcd->phy);
-		phy_put(hcd->phy);
-		hcd->phy = NULL;
-	}
 	if (hcd->remove_phy && hcd->usb_phy) {
 		usb_phy_shutdown(hcd->usb_phy);
 		usb_put_phy(hcd->usb_phy);
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 9e8fc9c5f394..e464c7384bd5 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -103,7 +103,6 @@ struct usb_hcd {
 	 * other external phys should be software-transparent
 	 */
 	struct usb_phy		*usb_phy;
-	struct phy		*phy;
 	struct usb_phy_roothub	*phy_roothub;
 
 	/* Flags that need to be manipulated atomically because they can

WARNING: multiple messages have this Message-ID (diff)
From: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-ci5G2KO2hbZ+pU9mqzGVBQ@public.gmane.org,
	Peter.Chen-3arQi8VN3Tc@public.gmane.org
Cc: mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	Martin Blumenstingl
	<martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
Subject: [RFC/RFT usb-next v1 6/6] usb: core: hcd: remove support for initializing a single PHY
Date: Thu, 25 Jan 2018 01:16:39 +0100	[thread overview]
Message-ID: <20180125001639.14681-7-martin.blumenstingl@googlemail.com> (raw)
In-Reply-To: <20180125001639.14681-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>

With the new PHY wrapper in place we can now handle multiple PHYs.
Remove the code which handles only one generic PHY as this is now
covered (with support for multiple PHYs as well as suspend/resume
support) by the new PHY wrapper.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
---
 drivers/usb/core/hcd.c  | 37 -------------------------------------
 include/linux/usb/hcd.h |  1 -
 2 files changed, 38 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index fc99cddc117e..5d59e0b4d463 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2757,30 +2757,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
 		}
 	}
 
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
-		struct phy *phy = phy_get(hcd->self.sysdev, "usb");
-
-		if (IS_ERR(phy)) {
-			retval = PTR_ERR(phy);
-			if (retval == -EPROBE_DEFER)
-				goto err_phy;
-		} else {
-			retval = phy_init(phy);
-			if (retval) {
-				phy_put(phy);
-				goto err_phy;
-			}
-			retval = phy_power_on(phy);
-			if (retval) {
-				phy_exit(phy);
-				phy_put(phy);
-				goto err_phy;
-			}
-			hcd->phy = phy;
-			hcd->remove_phy = 1;
-		}
-	}
-
 	hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 	if (IS_ERR(hcd->phy_roothub)) {
 		retval = PTR_ERR(hcd->phy_roothub);
@@ -2959,13 +2935,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
 err_usb_phy_roothub_power_on:
 	usb_phy_roothub_exit(hcd->phy_roothub);
 err_phy_roothub_init:
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
-		phy_power_off(hcd->phy);
-		phy_exit(hcd->phy);
-		phy_put(hcd->phy);
-		hcd->phy = NULL;
-	}
-err_phy:
 	if (hcd->remove_phy && hcd->usb_phy) {
 		usb_phy_shutdown(hcd->usb_phy);
 		usb_put_phy(hcd->usb_phy);
@@ -3046,12 +3015,6 @@ void usb_remove_hcd(struct usb_hcd *hcd)
 	usb_phy_roothub_power_off(hcd->phy_roothub);
 	usb_phy_roothub_exit(hcd->phy_roothub);
 
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
-		phy_power_off(hcd->phy);
-		phy_exit(hcd->phy);
-		phy_put(hcd->phy);
-		hcd->phy = NULL;
-	}
 	if (hcd->remove_phy && hcd->usb_phy) {
 		usb_phy_shutdown(hcd->usb_phy);
 		usb_put_phy(hcd->usb_phy);
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 9e8fc9c5f394..e464c7384bd5 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -103,7 +103,6 @@ struct usb_hcd {
 	 * other external phys should be software-transparent
 	 */
 	struct usb_phy		*usb_phy;
-	struct phy		*phy;
 	struct usb_phy_roothub	*phy_roothub;
 
 	/* Flags that need to be manipulated atomically because they can
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: martin.blumenstingl@googlemail.com (Martin Blumenstingl)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/RFT usb-next v1 6/6] usb: core: hcd: remove support for initializing a single PHY
Date: Thu, 25 Jan 2018 01:16:39 +0100	[thread overview]
Message-ID: <20180125001639.14681-7-martin.blumenstingl@googlemail.com> (raw)
In-Reply-To: <20180125001639.14681-1-martin.blumenstingl@googlemail.com>

With the new PHY wrapper in place we can now handle multiple PHYs.
Remove the code which handles only one generic PHY as this is now
covered (with support for multiple PHYs as well as suspend/resume
support) by the new PHY wrapper.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/usb/core/hcd.c  | 37 -------------------------------------
 include/linux/usb/hcd.h |  1 -
 2 files changed, 38 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index fc99cddc117e..5d59e0b4d463 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2757,30 +2757,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
 		}
 	}
 
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
-		struct phy *phy = phy_get(hcd->self.sysdev, "usb");
-
-		if (IS_ERR(phy)) {
-			retval = PTR_ERR(phy);
-			if (retval == -EPROBE_DEFER)
-				goto err_phy;
-		} else {
-			retval = phy_init(phy);
-			if (retval) {
-				phy_put(phy);
-				goto err_phy;
-			}
-			retval = phy_power_on(phy);
-			if (retval) {
-				phy_exit(phy);
-				phy_put(phy);
-				goto err_phy;
-			}
-			hcd->phy = phy;
-			hcd->remove_phy = 1;
-		}
-	}
-
 	hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 	if (IS_ERR(hcd->phy_roothub)) {
 		retval = PTR_ERR(hcd->phy_roothub);
@@ -2959,13 +2935,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
 err_usb_phy_roothub_power_on:
 	usb_phy_roothub_exit(hcd->phy_roothub);
 err_phy_roothub_init:
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
-		phy_power_off(hcd->phy);
-		phy_exit(hcd->phy);
-		phy_put(hcd->phy);
-		hcd->phy = NULL;
-	}
-err_phy:
 	if (hcd->remove_phy && hcd->usb_phy) {
 		usb_phy_shutdown(hcd->usb_phy);
 		usb_put_phy(hcd->usb_phy);
@@ -3046,12 +3015,6 @@ void usb_remove_hcd(struct usb_hcd *hcd)
 	usb_phy_roothub_power_off(hcd->phy_roothub);
 	usb_phy_roothub_exit(hcd->phy_roothub);
 
-	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
-		phy_power_off(hcd->phy);
-		phy_exit(hcd->phy);
-		phy_put(hcd->phy);
-		hcd->phy = NULL;
-	}
 	if (hcd->remove_phy && hcd->usb_phy) {
 		usb_phy_shutdown(hcd->usb_phy);
 		usb_put_phy(hcd->usb_phy);
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 9e8fc9c5f394..e464c7384bd5 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -103,7 +103,6 @@ struct usb_hcd {
 	 * other external phys should be software-transparent
 	 */
 	struct usb_phy		*usb_phy;
-	struct phy		*phy;
 	struct usb_phy_roothub	*phy_roothub;
 
 	/* Flags that need to be manipulated atomically because they can
-- 
2.16.1

             reply	other threads:[~2018-01-25  0:16 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25  0:16 Martin Blumenstingl [this message]
2018-01-25  0:16 ` [RFC/RFT usb-next v1 6/6] usb: core: hcd: remove support for initializing a single PHY Martin Blumenstingl
2018-01-25  0:16 ` Martin Blumenstingl
  -- strict thread matches above, loose matches on Subject: below --
2018-02-05  7:25 [RFC/RFT,usb-next,v1,5/6] usb: chipidea: do not set the "phy" field in struct usb_hcd Peter Chen
2018-02-05  7:25 ` [RFC/RFT usb-next v1 5/6] " Peter Chen
2018-02-05  7:25 ` Peter Chen
2018-02-04 21:39 [RFC/RFT,usb-next,v1,5/6] " Martin Blumenstingl
2018-02-04 21:39 ` [RFC/RFT usb-next v1 5/6] " Martin Blumenstingl
2018-02-04 21:39 ` Martin Blumenstingl
2018-01-29  3:30 [RFC/RFT,usb-next,v1,5/6] " Peter Chen
2018-01-29  3:30 ` [RFC/RFT usb-next v1 5/6] " Peter Chen
2018-01-29  3:30 ` Peter Chen
2018-01-26 21:05 [RFC/RFT,usb-next,v1,5/6] " Martin Blumenstingl
2018-01-26 21:05 ` [RFC/RFT usb-next v1 5/6] " Martin Blumenstingl
2018-01-26 21:05 ` Martin Blumenstingl
2018-01-26  9:06 [RFC/RFT,usb-next,v1,5/6] " Peter Chen
2018-01-26  9:06 ` [RFC/RFT usb-next v1 5/6] " Peter Chen
2018-01-26  9:06 ` Peter Chen
2018-01-25 20:03 [RFC/RFT,usb-next,v1,1/6] usb: mtu3: remove custom USB PHY handling Martin Blumenstingl
2018-01-25 20:03 ` [RFC/RFT usb-next v1 1/6] " Martin Blumenstingl
2018-01-25 20:03 ` Martin Blumenstingl
2018-01-25 15:55 [RFC/RFT,usb-next,v1,3/6] usb: host: ehci-platform: " Alan Stern
2018-01-25 15:55 ` [RFC/RFT usb-next v1 3/6] " Alan Stern
2018-01-25 15:55 ` Alan Stern
2018-01-25  2:47 [RFC/RFT,usb-next,v1,1/6] usb: mtu3: " Chunfeng Yun
2018-01-25  2:47 ` [RFC/RFT usb-next v1 1/6] " Chunfeng Yun
2018-01-25  2:47 ` Chunfeng Yun
2018-01-25  0:16 [RFC/RFT,usb-next,v1,5/6] usb: chipidea: do not set the "phy" field in struct usb_hcd Martin Blumenstingl
2018-01-25  0:16 ` [RFC/RFT usb-next v1 5/6] " Martin Blumenstingl
2018-01-25  0:16 ` Martin Blumenstingl
2018-01-25  0:16 [RFC/RFT,usb-next,v1,4/6] usb: host: ohci-platform: remove custom USB PHY handling Martin Blumenstingl
2018-01-25  0:16 ` [RFC/RFT usb-next v1 4/6] " Martin Blumenstingl
2018-01-25  0:16 ` Martin Blumenstingl
2018-01-25  0:16 [RFC/RFT,usb-next,v1,3/6] usb: host: ehci-platform: " Martin Blumenstingl
2018-01-25  0:16 ` [RFC/RFT usb-next v1 3/6] " Martin Blumenstingl
2018-01-25  0:16 ` Martin Blumenstingl
2018-01-25  0:16 [RFC/RFT,usb-next,v1,2/6] usb: host: xhci-mtk: " Martin Blumenstingl
2018-01-25  0:16 ` [RFC/RFT usb-next v1 2/6] " Martin Blumenstingl
2018-01-25  0:16 ` Martin Blumenstingl
2018-01-25  0:16 [RFC/RFT,usb-next,v1,1/6] usb: mtu3: " Martin Blumenstingl
2018-01-25  0:16 ` [RFC/RFT usb-next v1 1/6] " Martin Blumenstingl
2018-01-25  0:16 ` Martin Blumenstingl
2018-01-25  0:16 [RFC/RFT usb-next v1 0/6] remove driver-specific "multiple PHY" handling Martin Blumenstingl
2018-01-25  0:16 ` Martin Blumenstingl

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=20180125001639.14681-7-martin.blumenstingl@googlemail.com \
    --to=martin.blumenstingl@googlemail.com \
    --cc=Peter.Chen@nxp.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@prisktech.co.nz \
    --cc=mathias.nyman@intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=stern@rowland.harvard.edu \
    /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.