From patchwork Sat Apr 14 13:06:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10341227 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 DB3906039A for ; Sat, 14 Apr 2018 13:07:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9C8228A83 for ; Sat, 14 Apr 2018 13:07:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE56428A87; Sat, 14 Apr 2018 13:07:08 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 5C4B328A83 for ; Sat, 14 Apr 2018 13:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbeDNNHF (ORCPT ); Sat, 14 Apr 2018 09:07:05 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:45538 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbeDNNGq (ORCPT ); Sat, 14 Apr 2018 09:06:46 -0400 Received: by mail-lf0-f67.google.com with SMTP id q5-v6so16060118lff.12; Sat, 14 Apr 2018 06:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mk7twCET9cBgyGhMSpfm40QCcoMbIQRWE9MTHn1Wc24=; b=oGyzXy6Zck62uMqN7hQiPn+hCdRXL7uvKCZ+T26FTiqaFCFv4Yql17eVwZbjXogdJc hKvDogm09TTF/2FKktOY5MvfGHZI/qeCbDoaKUTmQGEfpggZ5VsJjLrlEfbef66bhRJr CfHbv0oBoKHKSP9Lvji41NYrjqGNbOL+xfZwzoh+cftZbcLVclh8QzEUObnCFTl8qsFU w2p6WV1pUcxc6diMr+sThvfp/pa085cJo4tM/LrFA5fHvfIcL0Wbw4/Co/mqHFgAJluK aXFoYEngBjQ3h3xwTDPoK0ENDA5SyrrTqKQRTU/9AQSxIS79Dc161MySxryw7mos4phs IyAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Mk7twCET9cBgyGhMSpfm40QCcoMbIQRWE9MTHn1Wc24=; b=qlZnctUKutv5VM1XJ1g9DhOCrvdMZlgUtHYjd420lGEredRut+mtgeEt9Ld0M/twrP r0RCc+wZvnYeqWM0N/1QybOmRIbHB4xsB6V8vl0H/9f5rPXe5W5tOnVWhmuYYc1we8Ur 61ZaSmcVfdsvi7BeSQ2ZfnLe5c1oiYw6RcnNG7Tw0ZgELvpHvE+7Kla+Lgipzdya7kF+ HqF5OTS6NMVGvDXG+t3NsPr/gt1kgSvXmeC81TCTxABT19JAVarsOscMmnBSPgPpKB+u hACMjIeFy/ndIta0os8YNC5S+v8/wCRmmmko+xJIxNv/VHPbp4H68aKO1Yv8maeJayw7 2GYA== X-Gm-Message-State: ALQs6tBLzj82LokauqG/M+jVPftBtnYtmzLRaomFVDRnvIf8qiOECdB6 E72Xf3hvdKJ8GtrF8m7go8fOlFGh X-Google-Smtp-Source: AIpwx48iBfXjrLsYhLRrbwCi5/9UR73fQry+KB6Zal/PHgLNaF4IRi2QnYoqv7q7rQI9+rb4cfASkw== X-Received: by 10.46.136.77 with SMTP id z13mr5343366ljj.126.1523711204878; Sat, 14 Apr 2018 06:06:44 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id z18-v6sm498117lfj.8.2018.04.14.06.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Apr 2018 06:06:42 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1f7Kt5-00063w-Iq; Sat, 14 Apr 2018 15:06:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman , Felipe Balbi Cc: Alan Stern , Bin Liu , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Johan Hovold Subject: [PATCH 2/6] USB: core: hcd: drop support for legacy phys Date: Sat, 14 Apr 2018 15:06:14 +0200 Message-Id: <20180414130618.23249-3-johan@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180414130618.23249-1-johan@kernel.org> References: <20180414130618.23249-1-johan@kernel.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop support for looking up and initialising legacy phys in USB core, something which hasn't been used by a mainline kernel since commit 9080b8dc761a ("ARM: OMAP2+: Remove legacy usb-host.c platform init code"). Specifically, since that commit usb_get_phy_dev() have always returned -ENODEV and consequently this code has not been used. Signed-off-by: Johan Hovold --- drivers/usb/core/hcd.c | 38 +++----------------------------------- include/linux/usb/hcd.h | 1 - 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 777036ae6367..6241d32c5ba7 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include "usb.h" @@ -2739,30 +2738,10 @@ int usb_add_hcd(struct usb_hcd *hcd, int retval; struct usb_device *rhdev; - if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->skip_phy_initialization) { - struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0); - - if (IS_ERR(phy)) { - retval = PTR_ERR(phy); - if (retval == -EPROBE_DEFER) - return retval; - } else { - retval = usb_phy_init(phy); - if (retval) { - usb_put_phy(phy); - return retval; - } - hcd->usb_phy = phy; - hcd->remove_phy = 1; - } - } - if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev); - if (IS_ERR(hcd->phy_roothub)) { - retval = PTR_ERR(hcd->phy_roothub); - goto err_phy_roothub_init; - } + if (IS_ERR(hcd->phy_roothub)) + return PTR_ERR(hcd->phy_roothub); retval = usb_phy_roothub_power_on(hcd->phy_roothub); if (retval) @@ -2936,12 +2915,7 @@ int usb_add_hcd(struct usb_hcd *hcd, usb_phy_roothub_power_off(hcd->phy_roothub); err_usb_phy_roothub_power_on: usb_phy_roothub_exit(hcd->phy_roothub); -err_phy_roothub_init: - if (hcd->remove_phy && hcd->usb_phy) { - usb_phy_shutdown(hcd->usb_phy); - usb_put_phy(hcd->usb_phy); - hcd->usb_phy = NULL; - } + return retval; } EXPORT_SYMBOL_GPL(usb_add_hcd); @@ -3017,12 +2991,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 (hcd->remove_phy && hcd->usb_phy) { - usb_phy_shutdown(hcd->usb_phy); - usb_put_phy(hcd->usb_phy); - hcd->usb_phy = NULL; - } - usb_put_invalidate_rhdev(hcd); hcd->flags = 0; } diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index aef50cb2ed1b..e33009c77840 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -150,7 +150,6 @@ struct usb_hcd { unsigned rh_pollable:1; /* may we poll the root hub? */ unsigned msix_enabled:1; /* driver has MSI-X enabled? */ unsigned msi_enabled:1; /* driver has MSI enabled? */ - unsigned remove_phy:1; /* auto-remove USB phy */ /* * do not manage the PHY state in the HCD core, instead let the driver * handle this (for example if the PHY can only be turned on after a