From patchwork Wed Apr 18 09:26:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10347681 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 4AF8060244 for ; Wed, 18 Apr 2018 09:29:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4670128434 for ; Wed, 18 Apr 2018 09:29:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ADAB28590; Wed, 18 Apr 2018 09:29:28 +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 C082828434 for ; Wed, 18 Apr 2018 09:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753318AbeDRJ3Z (ORCPT ); Wed, 18 Apr 2018 05:29:25 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:37614 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752762AbeDRJ1a (ORCPT ); Wed, 18 Apr 2018 05:27:30 -0400 Received: by mail-lf0-f68.google.com with SMTP id b23-v6so1600456lfg.4; Wed, 18 Apr 2018 02:27:29 -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=hIK+5e+F1aSN1nE5usN4X8fXUG0usFgFu9HYEglMs/1gHUqZnur8pPHQ7dnkOC7LZl S6MsMb4cbkoegEsryEioqTYmg6THoUgW0xlTuTwToDXs9Wdoze0ps1lTfdKqysAxcxZD fB0GHUAFWZd/1BIjP+q6MW+NKvKvzP7b5UqfZk7yV61lzMpjpmimzicdYu4OR66j2ObT NVc93nu9Vu+mZWgUQdIw/+pGD3QFiSopsv5P87BRI3lphhaMgN1J6QP6gASnI0XIt0VT oPUnyRyKsqFTpbyK1dUBNu7Z3x4dbpAv/oa1ibXKbRYYmNScKUnymA3+LrKE/EGlzpHM sUYQ== 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=RTVl5TIgEZXs//ugbKNpCHNOguscNoa6xL55goYO474UMptwQMGh2WIuLUyNovoVER 18QUipB5cPnqhVMk8na9RxIXvptUCoUcoghGMMf7FD8w95FIeB8PasXE5eV4fL3nuU+s P2MHmSxWnOJ8P/p9Sj5KYDMDPeeQAW258vvxZR+4Yq/WbfyORv1J5ZYwTqJDpGIQmQcH /mU8HzzmVuH/4IiNcCSXgvyTKLvqD7SKu+Z7nC+zeFx77nil+4HWueq9qrmvTXaBfxBU TW5fG65lri87FdJbC71eyo406r6/EtGrWnUP4to4Fv++HLTXZ1buFi5cuSu0/dO7wBCy UnXg== X-Gm-Message-State: ALQs6tAvSKip8wpuu1VkWUG79e6Bd1Hy+PyM7Y9hk5Hhu+AToNmFxuHx pmsFRb8PVbpcli2UtpsSmxQ= X-Google-Smtp-Source: AIpwx4/tkpoWBzjtz/E0Da+3qhljR7g3teEmLN83lx08a1x6xMaSBWF2AJmlZlqAIViXpxmFfgstHQ== X-Received: by 2002:a19:db54:: with SMTP id s81-v6mr964118lfg.143.1524043648417; Wed, 18 Apr 2018 02:27:28 -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 22sm132054ljv.45.2018.04.18.02.27.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Apr 2018 02:27:26 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1f8jN7-0003ER-7Z; Wed, 18 Apr 2018 11:27:25 +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, Yoshihiro Shimoda , Johan Hovold Subject: [PATCH v2 2/6] USB: core: hcd: drop support for legacy phys Date: Wed, 18 Apr 2018 11:26:20 +0200 Message-Id: <20180418092624.12361-3-johan@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180418092624.12361-1-johan@kernel.org> References: <20180418092624.12361-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