From patchwork Fri May 5 06:12:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 98603 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp35833qge; Thu, 4 May 2017 23:13:44 -0700 (PDT) X-Received: by 10.99.119.137 with SMTP id s131mr1361009pgc.116.1493964824859; Thu, 04 May 2017 23:13:44 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si4222420pld.200.2017.05.04.23.13.44; Thu, 04 May 2017 23:13:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932102AbdEEGNl (ORCPT + 4 others); Fri, 5 May 2017 02:13:41 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33993 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755814AbdEEGNb (ORCPT ); Fri, 5 May 2017 02:13:31 -0400 Received: by mail-pf0-f176.google.com with SMTP id e64so18056970pfd.1 for ; Thu, 04 May 2017 23:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=R6UNZB8lpUs0E/DF/qTVG8uRoEFpCAS+V0CI5QOr4tY=; b=ZJURPd4ep42g9uj1oVPgxkahHAw0A0JYQu7++d3ZsD1bc9N5z6BoU9OPgSutwjsZ52 Pk3SkdgLQo59FhP38mnuHqzqDMDRllbfIoH3hOnmTQt5136JoK8aTRf+AGcMLn9j2N4Y suV2dqZDp4xGxoySv6nYR7V6DZGcm0Qk9EviI= 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:in-reply-to:references; bh=R6UNZB8lpUs0E/DF/qTVG8uRoEFpCAS+V0CI5QOr4tY=; b=MNm4zan8PP8qigJy2x28MFTzEuq3qep+rbGhflxBJLPQhYsMwyweBEV3AKsC43Evlc W63hzFpx/2WzQlsUHh1YGF2tDg2ni4pPTsdZuDN2pi7fSx+AAdYh6t3kDcot5yZOenXA iumMWmlx1V9LuFG8D1EfjPEjVukLvk5NE93/eI7h0lqsNlMBvBzhEHOps2oTkCmLx7Uj tJG36DV+cjIt69vClaS1sHZVu47DEODqWAFzWIwixwU6KlSImmg2Kuny/SjlPtTe6hG4 Y9ueQGn8lwo8ckTLHtih04ivIG2R4bx9uCpELpo4W3FuWxGkJxShelIA3WZIApNS9JBB TC2w== X-Gm-Message-State: AN3rC/7As0TBVFCsiuOmum8i2pYId830st72ABLZYIA1TeaPa67t/ty5 k3auDleFcvGv2VK3 X-Received: by 10.98.219.197 with SMTP id f188mr15020538pfg.109.1493964806149; Thu, 04 May 2017 23:13:26 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id l198sm1298760pga.50.2017.05.04.23.13.23 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 May 2017 23:13:25 -0700 (PDT) From: Baolin Wang To: balbi@kernel.org, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, neilb@suse.com, jun.li@nxp.com, peter.chen@freescale.com, broonie@kernel.org, baolin.wang@linaro.org Subject: [PATCH v3 2/3] usb: phy: phy-qcom-8x16-usb: Remove redundant extcon register/unregister Date: Fri, 5 May 2017 14:12:25 +0800 Message-Id: <1257bfa62de2149b2ff8eb4f1626159aa76b0015.1493963244.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Since usb phy core has added common code to register or unregister extcon device, then phy-qcom-8x16-usb driver does not need its own code to register/unregister extcon device, then remove them. Signed-off-by: Baolin Wang --- drivers/usb/phy/phy-qcom-8x16-usb.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c index fdf6863..b6a83a5 100644 --- a/drivers/usb/phy/phy-qcom-8x16-usb.c +++ b/drivers/usb/phy/phy-qcom-8x16-usb.c @@ -69,9 +69,6 @@ struct phy_8x16 { struct reset_control *phy_reset; - struct extcon_dev *vbus_edev; - struct notifier_block vbus_notify; - struct gpio_desc *switch_gpio; struct notifier_block reboot_notify; }; @@ -131,7 +128,8 @@ static int phy_8x16_vbus_off(struct phy_8x16 *qphy) static int phy_8x16_vbus_notify(struct notifier_block *nb, unsigned long event, void *ptr) { - struct phy_8x16 *qphy = container_of(nb, struct phy_8x16, vbus_notify); + struct usb_phy *usb_phy = container_of(nb, struct usb_phy, vbus_nb); + struct phy_8x16 *qphy = container_of(usb_phy, struct phy_8x16, phy); if (event) phy_8x16_vbus_on(qphy); @@ -187,7 +185,7 @@ static int phy_8x16_init(struct usb_phy *phy) val = ULPI_PWR_OTG_COMP_DISABLE; usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG)); - state = extcon_get_state(qphy->vbus_edev, EXTCON_USB); + state = extcon_get_state(qphy->phy.edev, EXTCON_USB); if (state) phy_8x16_vbus_on(qphy); else @@ -289,15 +287,13 @@ static int phy_8x16_probe(struct platform_device *pdev) phy->io_priv = qphy->regs + HSPHY_ULPI_VIEWPORT; phy->io_ops = &ulpi_viewport_access_ops; phy->type = USB_PHY_TYPE_USB2; + phy->vbus_nb.notifier_call = phy_8x16_vbus_notify; + phy->id_nb.notifier_call = NULL; ret = phy_8x16_read_devicetree(qphy); if (ret < 0) return ret; - qphy->vbus_edev = extcon_get_edev_by_phandle(phy->dev, 0); - if (IS_ERR(qphy->vbus_edev)) - return PTR_ERR(qphy->vbus_edev); - ret = clk_set_rate(qphy->core_clk, INT_MAX); if (ret < 0) dev_dbg(phy->dev, "Can't boost core clock\n"); @@ -315,12 +311,6 @@ static int phy_8x16_probe(struct platform_device *pdev) if (WARN_ON(ret)) goto off_clks; - qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify; - ret = devm_extcon_register_notifier(&pdev->dev, qphy->vbus_edev, - EXTCON_USB, &qphy->vbus_notify); - if (ret < 0) - goto off_power; - ret = usb_add_phy_dev(&qphy->phy); if (ret) goto off_power;