From patchwork Mon Jan 16 12:37:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9518633 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 CE54A6020B for ; Mon, 16 Jan 2017 12:39:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B179C281F9 for ; Mon, 16 Jan 2017 12:39:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A43BF2824F; Mon, 16 Jan 2017 12:39:03 +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, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47D29281F9 for ; Mon, 16 Jan 2017 12:39:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cT6Yw-00008o-8D; Mon, 16 Jan 2017 12:39:02 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cT6Xn-0006hN-7G for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2017 12:37:53 +0000 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV019YZHQ2WLD0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2017 21:37:14 +0900 (KST) Received: from epsmges1p8.samsung.com (unknown [182.195.40.67]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170116123714epcas1p4d0e58074b99adca4ea495ec191baf36f~aQMMx0Nkm2878428784epcas1p4E; Mon, 16 Jan 2017 12:37:14 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p8.samsung.com (Symantec Messaging Gateway) with SMTP id 76.0D.09088.A7EBC785; Mon, 16 Jan 2017 21:37:14 +0900 (KST) Received: from epcpsbgm1new.samsung.com (u26.gpu120.samsung.co.kr [203.254.230.26]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116123713epcas1p19bc73cb17dae04e8ed087b45accd4f15~aQMMetQXc1636916369epcas1p10; Mon, 16 Jan 2017 12:37:13 +0000 (GMT) X-AuditID: b6c32a3c-f79826d000002380-69-587cbe7a55eb Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 57.BC.08931.97EBC785; Mon, 16 Jan 2017 21:37:13 +0900 (KST) Received: from localhost.localdomain ([10.113.62.212]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00E5AHQ1PE30@mmp1.samsung.com>; Mon, 16 Jan 2017 21:37:13 +0900 (KST) From: Chanwoo Choi To: balbi@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH v3 4/6] usb: phy: qcom-8x16-usb: Replace the extcon API Date: Mon, 16 Jan 2017 21:37:00 +0900 Message-id: <1484570222-30522-5-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1484570222-30522-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHKsWRmVeSWpSXmKPExsWy7bCmgW7VvpoIg617+SyOtT1ht5h44wqL xfUvz1ktm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Pgaq8XlXXPYLBYta2V2YPfYtKqTzWP/3DXsHpuX1Hv0bVnF6PF5k1wA a5SbTUZqYkpqkUJqXnJ+SmZeuq1SaIibroWSQl5ibqqtUoSub0iQkkJZYk4pkGdkgAYcnAPc g5X07RLcMr5evMNW8EGgYs7TSWwNjIv5uhg5OSQETCSevL3CDGGLSVy4t56ti5GLQ0hgKaPE o/8nmCCcH4wS85ZNYwGpYhPQktj/4gZQFQeHiICBRNsNMZAaZoH5jBK7L7xgBakRFnCXWLP1 O1g9i4CqxPozT8FsXgFXiZ7Hx5ggtslJfNjziB1kDqeAm8TyHleQsBBQyapvvYwTGHkXMDKs YpRILUguKE5KzzXMSy3XK07MLS7NS9dLzs/dxAgO6GdSOxgP7nI/xCjAwajEw7tgR3WEEGti WXFl7iFGCQ5mJRFe9501EUK8KYmVValF+fFFpTmpxYcYTYHumsgsJZqcD4y2vJJ4QxNzE3Nj AwtzS0sTIyVx3sbZz8KFBNITS1KzU1MLUotg+pg4OKUaGPUd7hm46JxaweflVLSMObVeQPFN YqZEW6jtxfNlbk27Slut1oRxcxvyKQSnmL2dXbeQ3VtOISU30SrK5+iFoOlO8y0K7C8vjTRM Yfu169uFil2r5douPv/wfdrzlNMlF1fdXKJjOeuZg+xLl8WtM+1LdhcIO7ztf8Hgv/OU6LZo x1WL9qi0K7EUZyQaajEXFScCAHJaWRd+AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116123713epcas1p19bc73cb17dae04e8ed087b45accd4f15 X-Msg-Generator: CA X-Sender-IP: 203.254.230.26 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbUzUo7LGF7J6EKS9DaGFuZ2UgQWdlbnQ=?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTNS9TZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NUQUYbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170116123713epcas1p19bc73cb17dae04e8ed087b45accd4f15 X-RootMTR: 20170116123713epcas1p19bc73cb17dae04e8ed087b45accd4f15 References: <1484570222-30522-1-git-send-email-cw00.choi@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170116_043751_419539_3AE4B382 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chanwoo Choi , chanwoo@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch uses the resource-managed extcon API for extcon_register_notifier() and replaces the deprecated extcon API as following: - extcon_get_cable_state_() -> extcon_get_state() Signed-off-by: Chanwoo Choi Acked-by: Felipe Balbi --- drivers/usb/phy/phy-qcom-8x16-usb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c index d8593adb3621..fdf686398772 100644 --- a/drivers/usb/phy/phy-qcom-8x16-usb.c +++ b/drivers/usb/phy/phy-qcom-8x16-usb.c @@ -187,7 +187,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_cable_state_(qphy->vbus_edev, EXTCON_USB); + state = extcon_get_state(qphy->vbus_edev, EXTCON_USB); if (state) phy_8x16_vbus_on(qphy); else @@ -316,23 +316,20 @@ static int phy_8x16_probe(struct platform_device *pdev) goto off_clks; qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify; - ret = extcon_register_notifier(qphy->vbus_edev, EXTCON_USB, - &qphy->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_extcon; + goto off_power; qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify; register_reboot_notifier(&qphy->reboot_notify); return 0; -off_extcon: - extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB, - &qphy->vbus_notify); off_power: regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); off_clks: @@ -347,8 +344,6 @@ static int phy_8x16_remove(struct platform_device *pdev) struct phy_8x16 *qphy = platform_get_drvdata(pdev); unregister_reboot_notifier(&qphy->reboot_notify); - extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB, - &qphy->vbus_notify); /* * Ensure that D+/D- lines are routed to uB connector, so