From patchwork Thu Jan 25 00:16:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10183415 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 7E05860567 for ; Thu, 25 Jan 2018 00:17:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 744B826BE9 for ; Thu, 25 Jan 2018 00:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68F1E27FE4; Thu, 25 Jan 2018 00:17:06 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1662D28161 for ; Thu, 25 Jan 2018 00:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=i78xoUCrfWvugp9vdgfHiKcjL6RCwIElWjfZXNOyTq0=; b=kDcOsF+FkRTYIYfeQQ4AM2T/qh Zc3xF0PemLOZx9SyOHH1vImC4rdFNTqPUIB2aEnmOJOn2DrIY7WdExAc5kGonIld8UwKcCzAyt5RV iM5WzH4/s6jBXy4orZBHVOK1ox8uVBEBuy28D/XdMwx3ZF/8iRqVsdgLYfLzCT4sZ1HUiLcK2pcU9 5eAYN+dx0DnuSiLm/+Y5i2BGJBGHKXuSVJpOim1oiACO7/js+1d5Fg2apv4zLVJl82xRAi6JJ0nys eiResmAc6lkcBDvOdvmyMET4mGWszCca/aEzfJr8rfItRBeyyOJUsXWSL7thMyS0tQ30xiuvOF9N0 S90Zwy/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eeVDy-0000oQ-UF; Thu, 25 Jan 2018 00:17:02 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eeVDw-0000nV-1l; Thu, 25 Jan 2018 00:17:01 +0000 Received: by mail-wm0-x241.google.com with SMTP id b21so11828598wme.4; Wed, 24 Jan 2018 16:16:58 -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=qKT0FVjna15PedNMf1wTudyzMnqRRkxDhlLo9NF6O5c=; b=fmpOBcWSiSmwkQFybCnfrjRhG/Iv5sDjjaDwkJ9jxmNOg3tiFxAOqn/8fqbBHKskvA y5dFMlJycSwZKT17JAcDnVTJ/wLm3jPYQJIW+MjItsOWDtjcK0yFyRmMjjzze1ErR55r poHmZXLF9VyFPsmdNI59te0YEj90/yT/rZUM/WjPP5sR2QenNrDP//sUiM39Uls5ZotO upPuH3qQHkyK4D8Rcn1yoY4Ebwgs8xM3FDbcH8NBVytCtfE/aSEwKhMpmvkEJtsP1Wfp L5bqMC3PEziURYD5khtY/7F3DxhQFw9cI0Ta47OGe1B9mqJUhj7VDoVNZse9xqzREOe0 S2Jg== 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=qKT0FVjna15PedNMf1wTudyzMnqRRkxDhlLo9NF6O5c=; b=gMZCIUYkqfM9KVHqG/5yoU/b8XKCy2NztgwILXrj8TJokwnvSKqYMttR71pSysrNVk sHtLLjrcMs1UQMc9vbkEyyYS67PtAHXeWSAkhl39jkgYJ9SiIKJPNPXX6Rw9PXnoAfaB q7C21SmEEXcoueiEiC/oL20tBuc12uyJ8Nb3JHI8IUe7I20E5YKUAr8arj7hGNopN5tU WR8HFf0rMbj/jm9/YvbMVs5LwSNWUQlRQWP3shMNkLerftygAgPVsFzyPvb+nQbx/K4y Xx7NdQUIBHzC1hZMXFEwLiIFt6oMwBc3kiXYSuXXc+wgGM0pzbBZrUDO5mDmTPge/Q6U ygOw== X-Gm-Message-State: AKwxytfKm6IV2EN9Tu+3VYeIeeqD5WcZ9eIsEnnI5Q020aUX2p8cjr3F ijul1ftm2DcPTJKHvvpcFbQ= X-Google-Smtp-Source: AH8x227xMLrxDg7YvPMYkCFhZLht7Y6jD5663PD+1sYN7FK1QzhggWsF6yMER2tg/gzFtyiqPK2o0Q== X-Received: by 10.28.133.129 with SMTP id h123mr6463983wmd.146.1516839417410; Wed, 24 Jan 2018 16:16:57 -0800 (PST) Received: from blackbox.darklights.net (p5DD9B1B3.dip0.t-ipconnect.de. [93.217.177.179]) by smtp.googlemail.com with ESMTPSA id e15sm1699159wmd.26.2018.01.24.16.16.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 16:16:56 -0800 (PST) From: Martin Blumenstingl 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 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 Message-Id: <20180125001639.14681-7-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180125001639.14681-1-martin.blumenstingl@googlemail.com> References: <20180125001639.14681-1-martin.blumenstingl@googlemail.com> X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , gregkh@linuxfoundation.org, stern@rowland.harvard.edu, mathias.nyman@intel.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.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 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