From patchwork Fri Dec 30 04:08:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9491715 X-Patchwork-Delegate: geert@linux-m68k.org 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 761C360838 for ; Fri, 30 Dec 2016 04:08:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 642E21FFD6 for ; Fri, 30 Dec 2016 04:08:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 574362018E; Fri, 30 Dec 2016 04:08:57 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 EABE21FFD6 for ; Fri, 30 Dec 2016 04:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753481AbcL3EIX (ORCPT ); Thu, 29 Dec 2016 23:08:23 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:56998 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753273AbcL3EIU (ORCPT ); Thu, 29 Dec 2016 23:08:20 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OIZ00T6BCTTA310@mailout2.samsung.com>; Fri, 30 Dec 2016 13:08:17 +0900 (KST) Received: from epsmges5p3.samsung.com (unknown [182.195.40.64]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20161230040817epcas1p38374cb680e8a1c792f2399efcc83d25c~U7R_YNufZ1121211212epcas1p3W; Fri, 30 Dec 2016 04:08:17 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3.samsung.com (EPCPMTA) with SMTP id 3F.3C.27486.1BDD5685; Fri, 30 Dec 2016 13:08:17 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20161230040816epcas5p47433110fddafafca1a8b8a64acee1835~U7R_F8ak20078900789epcas5p4K; Fri, 30 Dec 2016 04:08:16 +0000 (GMT) X-AuditID: b6c32a2e-f79b36d000006b5e-07-5865ddb1d9c2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 77.A1.28332.0BDD5685; Fri, 30 Dec 2016 13:08:16 +0900 (KST) Received: from localhost.localdomain ([10.113.62.212]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OIZ0030ECTSVT80@mmp2.samsung.com>; Fri, 30 Dec 2016 13:08:16 +0900 (KST) From: Chanwoo Choi To: balbi@kernel.org, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, chanwoo@kernel.org, Chanwoo Choi Subject: [PATCH v2 3/6] usb: phy: omap-otg: Replace the extcon API Date: Fri, 30 Dec 2016 13:08:12 +0900 Message-id: <1483070895-8213-4-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1483070895-8213-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLKsWRmVeSWpSXmKPExsWy7bCmlu7Gu6kRBluP8loca3vCbjHxxhUW i+tfnrNa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68ns3i8q45bBazl/SzWGx9+Y7JYtGyVmYHDo9NqzrZPPbPXcPu0bdlFaPH501y ASxRbjYZqYkpqUUKqXnJ+SmZeem2SqEhbroWSgp5ibmptkoRur4hQUoKZYk5pUCekQEacHAO cA9W0rdLcMu48X8jc8EmwYqz65axNDC+4Oti5OCQEDCRmPxfuouRE8gUk7hwbz1bFyMXh5DA LEaJ5s9PmSCcH4wS3be+sIFUsQloSex/cYMNpFlEwECi7YYYSA2zwA5GiXlLT4PVCAs4STy6 vIUFxGYRUJX41zaXEaSeV8BFovVmNMQyOYkPex6xg9icAq4S77adYwWxhYBKlp85wz6BkXcB I8MqRonUguSC4qT0XKO81HK94sTc4tK8dL3k/NxNjOCAfia9g/HwLvdDjAIcjEo8vD/KUiOE WBPLiitzDzFKcDArifAW3gYK8aYkVlalFuXHF5XmpBYfYjQFumsis5Rocj4w2vJK4g1NzE3M jQ0szC0tTYyUxHkbZz8LFxJITyxJzU5NLUgtgulj4uCUamCc5PMu86L0xTuFakdyv2kunCaU KMXDZPSx8GvX/py31dtuLP8um2q7JWp7zeq42uvy/YWxPxZPu9/vnX4/5r3itPsB0couH5/z 8MpXTDLfVKi8y3XHppvz3yu+O22wf0ndV+aNV2dKfNPWX3fYau9y5a4CH7c3q6Iua786sCsi 5bHn9R3f055eVmIpzkg01GIuKk4EAKV2WT5+AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161230040816epcas5p47433110fddafafca1a8b8a64acee1835 X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 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: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20161230040816epcas5p47433110fddafafca1a8b8a64acee1835 X-RootMTR: 20161230040816epcas5p47433110fddafafca1a8b8a64acee1835 References: <1483070895-8213-1-git-send-email-cw00.choi@samsung.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.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-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", },