From patchwork Sat Mar 3 21:43:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10256207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B87586037E for ; Sat, 3 Mar 2018 21:43:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACB98287A1 for ; Sat, 3 Mar 2018 21:43:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1762287A6; Sat, 3 Mar 2018 21:43:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15354287A1 for ; Sat, 3 Mar 2018 21:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932193AbeCCVnt (ORCPT ); Sat, 3 Mar 2018 16:43:49 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:42444 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932167AbeCCVnp (ORCPT ); Sat, 3 Mar 2018 16:43:45 -0500 Received: by mail-wr0-f194.google.com with SMTP id k9so13470275wre.9; Sat, 03 Mar 2018 13:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kvwzby3UVUcwvj5FaEyIxid7nLbjZ02BLfnJ+uzZmEw=; b=tsnEepf/WwcB0gQunuFbgIoC+Ll29UI28IfOkqPPLuFSdcfcnIazJwdYyXsE9dcsNS pbnli0kcSi4tOWdo+VvH5VxrUoVx8fXa5aEL7eoGURMQ7+UrZgjDxViPhemBKpqLAdd5 IitoAVog7I9CTOU9qUUr/91IfZGrK1teU+MxrVqzjHOCLwK4isuvki5j0dslYjq92SRa c7VDlCQ4VrsKMuS6UDkAMR4wPQEDSBha5IhQSENp02Vw3BjG4mdnRcxrInATdk4vGe2h ampD1KIVTL0lPndEQ5LYTNLCFACmiWR2UsVOEkpWPHyhgPtZnL/9ve4nrS3AxKeCL45L k6sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kvwzby3UVUcwvj5FaEyIxid7nLbjZ02BLfnJ+uzZmEw=; b=MADSk4U18Avu4210zf9cB/LNjJKKTOnjnwu66kSqUcQGoj2lWcrjl0XCZ7ZDRWJuBx KsUmYf9rNol4laZUgcqPy+Gy2zUJfbT0RXv+iv2V93yGVUHNzV1vpN4MnBmxFSKpfQMs YoII/R2aaXb15utSnblEqkfTLw4UaZXWP3MxTL68l7m+YxQstNyAi18VBWc2TFbuEnFb uvGEpXa9D07W/Gja6WcWWiiKQutZIm2ZM/76Yxd4Y0WnHqwaN5HJdYRwxKzJCMQ883XK Jq7oIHeNMW0bAQOrEEk72ByJC37KYPLuLpCnUDJSHLemww3c1iDDJTGduG8UGlwUSKlu KWwA== X-Gm-Message-State: APf1xPCxJlj4+2OYRxK+8kDlUxTz8ssU7LNuFulPlactKpi1iaO5HJxA vSULo62w20F7FeCh5WpXw7e3SLLa X-Google-Smtp-Source: AG47ELsgj+a0r1dkqVR4gmZS+0F68diUqixDJa7zMRo4QkIdAiK7OKSjE7ivHE8vHuLGAXDjc9/YLw== X-Received: by 10.223.157.131 with SMTP id p3mr8289424wre.278.1520113423011; Sat, 03 Mar 2018 13:43:43 -0800 (PST) Received: from blackbox.darklights.net (p5DD9B279.dip0.t-ipconnect.de. [93.217.178.121]) by smtp.googlemail.com with ESMTPSA id 55sm11073171wrz.6.2018.03.03.13.43.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Mar 2018 13:43:42 -0800 (PST) From: Martin Blumenstingl To: linux-usb@vger.kernel.org, mathias.nyman@intel.com, arnd@arndb.de, gregkh@linuxfoundation.org, felipe.balbi@linux.intel.com Cc: linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, stern@rowland.harvard.edu, linux@prisktech.co.nz, Peter.Chen@nxp.com, matthias.bgg@gmail.com, mark.rutland@arm.com, robh+dt@kernel.org, narmstrong@baylibre.com, linux-amlogic@lists.infradead.org, yixun.lan@amlogic.com, Martin Blumenstingl Subject: [usb-next PATCH v11 8/8] usb: core: hcd: remove support for initializing a single PHY Date: Sat, 3 Mar 2018 22:43:09 +0100 Message-Id: <20180303214309.25643-9-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180303214309.25643-1-martin.blumenstingl@googlemail.com> References: <20180303214309.25643-1-martin.blumenstingl@googlemail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 32797c25ac3b..5a92d8f7c484 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->skip_phy_initialization) { - 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; - } - } - if (!hcd->skip_phy_initialization) { hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev); if (IS_ERR(hcd->phy_roothub)) { @@ -2961,13 +2937,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); @@ -3048,12 +3017,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 a042675e03ba..aef50cb2ed1b 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