From patchwork Mon Jan 16 12:36:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9518615 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 E00516020B for ; Mon, 16 Jan 2017 12:37:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C445D2823E for ; Mon, 16 Jan 2017 12:37:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B77A6281F9; Mon, 16 Jan 2017 12:37:53 +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 41854281F9 for ; Mon, 16 Jan 2017 12:37:52 +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 1cT6Xo-0006zd-76; Mon, 16 Jan 2017 12:37:52 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cT6XY-0006gk-BX for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2017 12:37:39 +0000 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV02V7PHQ2O020@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.65]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116123714epcas1p148acbb663a664923f1fd1bc5b485ee91~aQMMx9f7S1448514485epcas1p1w; Mon, 16 Jan 2017 12:37:14 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p8.samsung.com (Symantec Messaging Gateway) with SMTP id 86.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 20170116123713epcas1p12ccac45604795c862e272534be38788e~aQMMXZXf-1957219572epcas1p1Q; Mon, 16 Jan 2017 12:37:13 +0000 (GMT) X-AuditID: b6c32a3c-f79826d000002380-6a-587cbe7a90e2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id D6.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 3/6] usb: phy: omap-otg: Replace the extcon API Date: Mon, 16 Jan 2017 21:36:59 +0900 Message-id: <1484570222-30522-4-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+NgFjrMKsWRmVeSWpSXmKPExsWy7bCmvm7VvpoIgz2P+SyOtT1ht5h44wqL xfUvz1ktmhevZ7PY9Pg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MDh8emVZ1sHvvnrmH32Lyk3qNvyypG j8+b5AJYo9xsMlITU1KLFFLzkvNTMvPSbZVCQ9x0LZQU8hJzU22VInR9Q4KUFMoSc0qBPCMD NODgHOAerKRvl+CWcf3tfvaCS4IVc7ecZW1gbOXvYuTkkBAwkfg67w0bhC0mceHeeiCbi0NI YCmjxPKzc1ggnB+MEvOWTWMBqWIT0JLY/+IGUBUHh4iAgUTbDTGQMLPAbkaJNSeZQGxhASeJ qzufgQ1lEVCV+HbxO1grr4CrxLSfK1khlslJfNjziB1kDKeAm8TyHleQsBBQyapvvYwTGHkX MDKsYpRILUguKE5KzzXMSy3XK07MLS7NS9dLzs/dxAgO7GdSOxgP7nI/xCjAwajEw7tgR3WE EGtiWXFl7iFGCQ5mJRFe9501EUK8KYmVValF+fFFpTmpxYcYTYHumsgsJZqcD4y6vJJ4QxNz E3NjAwtzS0sTIyVx3sbZz8KFBNITS1KzU1MLUotg+pg4OKUaGNsjC47JWSYUCG3oCjsofU1u glu68d8DCsEXxJzv5NkHras0ux6+l5tJVEhqUa3UneLOnOXLf1YX5Jf9nbBlocqG9RsOfXkb +f2GoElC2Mt3+8W4fwSmvhXVlWme9ZG/mPU474SwZAftLyK36l8zm8zW/9jWnqcUfL/yeEpv +hKG28eZBR+tVGIpzkg01GIuKk4EABQEOg2CAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116123713epcas1p12ccac45604795c862e272534be38788e 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: 20170116123713epcas1p12ccac45604795c862e272534be38788e X-RootMTR: 20170116123713epcas1p12ccac45604795c862e272534be38788e 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_043736_554052_F4E68346 X-CRM114-Status: GOOD ( 12.64 ) 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: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chanwoo Choi , chanwoo@kernel.org, linux-omap@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() Cc: linux-omap@vger.kernel.org Signed-off-by: Chanwoo Choi Acked-by: Felipe Balbi --- drivers/usb/phy/phy-omap-otg.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c index 6523af4f8f93..800d1d90753d 100644 --- a/drivers/usb/phy/phy-omap-otg.c +++ b/drivers/usb/phy/phy-omap-otg.c @@ -118,19 +118,19 @@ static int omap_otg_probe(struct platform_device *pdev) otg_dev->id_nb.notifier_call = omap_otg_id_notifier; otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier; - ret = extcon_register_notifier(extcon, EXTCON_USB_HOST, &otg_dev->id_nb); + ret = devm_extcon_register_notifier(&pdev->dev, extcon, + EXTCON_USB_HOST, &otg_dev->id_nb); if (ret) return ret; - ret = extcon_register_notifier(extcon, EXTCON_USB, &otg_dev->vbus_nb); + ret = devm_extcon_register_notifier(&pdev->dev, extcon, + EXTCON_USB, &otg_dev->vbus_nb); if (ret) { - extcon_unregister_notifier(extcon, EXTCON_USB_HOST, - &otg_dev->id_nb); return ret; } - otg_dev->id = extcon_get_cable_state_(extcon, EXTCON_USB_HOST); - otg_dev->vbus = extcon_get_cable_state_(extcon, EXTCON_USB); + otg_dev->id = extcon_get_state(extcon, EXTCON_USB_HOST); + otg_dev->vbus = extcon_get_state(extcon, EXTCON_USB); omap_otg_set_mode(otg_dev); rev = readl(otg_dev->base); @@ -145,20 +145,8 @@ static int omap_otg_probe(struct platform_device *pdev) return 0; } -static int omap_otg_remove(struct platform_device *pdev) -{ - struct otg_device *otg_dev = platform_get_drvdata(pdev); - struct extcon_dev *edev = otg_dev->extcon; - - extcon_unregister_notifier(edev, EXTCON_USB_HOST, &otg_dev->id_nb); - extcon_unregister_notifier(edev, EXTCON_USB, &otg_dev->vbus_nb); - - return 0; -} - static struct platform_driver omap_otg_driver = { .probe = omap_otg_probe, - .remove = omap_otg_remove, .driver = { .name = "omap_otg", },