From patchwork Tue Mar 28 04:42:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9648075 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 81FB7602C8 for ; Tue, 28 Mar 2017 04:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7760027F4B for ; Tue, 28 Mar 2017 04:42:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 696A32835B; Tue, 28 Mar 2017 04:42:39 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7AC227F4B for ; Tue, 28 Mar 2017 04:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: Message-id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:List-Owner; bh=GMpEpbqr4hdn5SlqgasKY+hvaNxKtGucDDchoKd45lI=; b=sz Vw21gtcnDh28Sre5YdffxK3mggjC+9gZI+4krd6GOpi7oX6qD6kueS92BQP9zmvk+CPbM9mBcVcqs LM3dwWncDYJdKRYwGOVCb3vlgAHwN8y7y8frERhU9WO1jSgzkODu/96ouZUdn9r/f2H1sk0JYuq6B L8KTmSpc+tvLKSSWTFxA98o+51AYo3xlb8EO84TURMj8doGNNi3Nxli/+OL1aUR6GD95xtPBnWiGQ 4dC2N6zr/Z8AEiNTzcdiYU40Bt8yS+nfoFhh/dS5dAgM+XbSsUfScYw60NfxsloEws0Z/M2tw9+1z f88Xlau+6jbv7VEfP8qvEj6NrXnHCO5w==; 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 1csixp-0006Yy-2Y; Tue, 28 Mar 2017 04:42:37 +0000 Received: from mailout2.samsung.com ([203.254.224.25] helo=epoutp02.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1csixd-0006NT-In; Tue, 28 Mar 2017 04:42:27 +0000 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by epoutp02.samsung.com (KnoxPortal) with ESMTP id 20170328044204epoutp0283f3b9bafa5e1dbcb0fcd30c6ee4dca9~v8gmE0X-N0393203932epoutp02E; Tue, 28 Mar 2017 04:42:04 +0000 (GMT) Received: from epsmges5p4.samsung.com (unknown [182.195.40.66]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170328044204epcas1p44b7d98ad307a7cafa5ba10b7536eda2f~v8glyZoOK1754217542epcas1p4f; Tue, 28 Mar 2017 04:42:04 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p4.samsung.com (EPCPMTA) with SMTP id E1.02.07232.B99E9D85; Tue, 28 Mar 2017 13:42:04 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20170328044203epcas5p3a1c11c5eae084c06cdc5291f37232b83~v8glUK2_S2119021190epcas5p3_; Tue, 28 Mar 2017 04:42:03 +0000 (GMT) X-AuditID: b6c32a58-f79586d000001c40-20-58d9e99b8ffc Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 57.F5.05013.B99E9D85; Tue, 28 Mar 2017 13:42:03 +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 <0ONI0071GD23U4B0@mmp2.samsung.com>; Tue, 28 Mar 2017 13:42:03 +0900 (KST) From: Chanwoo Choi To: gregkh@linuxfoundation.org, matthias.bgg@gmail.com, chunfeng.yun@mediatek.com Subject: [PATCH] usb: mtu3: Replace the extcon API Date: Tue, 28 Mar 2017 13:42:02 +0900 Message-id: <1490676122-2655-1-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAAzWSbUhTYRSAe3fv3Ye5uCzTFyMdtyQcuHb34a7iylBiUJLkn6nJuunFSfuw 3Snmn9KcX/ShpBAywywVzVpNKZNIUzNCIy2rWTglq5VYVkoEmTR37d9zznnOe14OR4hIRrFI YYHVwdittJngh6B3h2Nj41xfpg2K2ceAqvdOoVTVw2aUerPix6iz19x8yjP/GqNe9rv41Muz k4BqbXciVHmFKlmkv980I9B7umr4+oHmboG+5/ppfcXTAVR/obcL6Jc9UemCLCbJxNB5jF3K WHNteQXWfB1xMMOYYtTEK8g4MoHSElIrbWF0ROqh9LgDBebAxwhpMW0uCqTSaZYl9uxNstuK HIzUZGMdOiKbJJVyUqGVK5VKuVqVk6jUBJRjjKnBP48WLkpKnGNucAbU4LVAJIS4Gi6MuFGO w+GEz82vBSFCCd4G4NQ7j4ALqnjwXl0H/3/HUssNjCu4AJxw1/G44DeAvzxLyLrFx2Vw4LM3 2BGGZ8CV1VZkXULwYQCvrk5g64WtuBJ+7OwNMorHwBfP/UEW46nw1tcxhBsXBb8/eC/geJkP u7+G1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JzllcQbmpibmBsb WJhbWpoYKYnzNs5+Fi4kkJ5YkpqdmlqQWgTTx8TBKdXA6Jjf8bwu/mtnYuz+qJOLVtycum0J nz7fc34GPx451bwDT66XP1lXF/iA6cDeRxuD72xoE2IVZmIQP7Z/ut3OSXWVf/Z/E1Lfdqr/ xWKtFGbuZzzz91/WC35e/HHCSp1nMXuDpX7tqp/h13IupKn4Y9zBnuW51cJ/8n+HXD14wUFI d3Wh3QyDk0osxRmJhlrMRcWJAJiACtF7AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170328044203epcas5p3a1c11c5eae084c06cdc5291f37232b83 X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NUQUYbQzEwVjgxMTE=?= CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170328044203epcas5p3a1c11c5eae084c06cdc5291f37232b83 X-RootMTR: 20170328044203epcas5p3a1c11c5eae084c06cdc5291f37232b83 References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170327_214225_907527_144DE8CA X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-mediatek@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 , linux-mediatek@lists.infradead.org, chanwoo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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: Greg Kroah-Hartman Cc: Chunfeng Yun Cc: linux-usb@vger.kernel.org Signed-off-by: Chanwoo Choi Tested-by: Chunfeng Yun Acked-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_dr.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_dr.c b/drivers/usb/mtu3/mtu3_dr.c index 1a8987e7c5b0..11a0d3b84c5e 100644 --- a/drivers/usb/mtu3/mtu3_dr.c +++ b/drivers/usb/mtu3/mtu3_dr.c @@ -223,25 +223,25 @@ static int ssusb_extcon_register(struct otg_switch_mtk *otg_sx) return 0; otg_sx->vbus_nb.notifier_call = ssusb_vbus_notifier; - ret = extcon_register_notifier(edev, EXTCON_USB, + ret = devm_extcon_register_notifier(ssusb->dev, edev, EXTCON_USB, &otg_sx->vbus_nb); if (ret < 0) dev_err(ssusb->dev, "failed to register notifier for USB\n"); otg_sx->id_nb.notifier_call = ssusb_id_notifier; - ret = extcon_register_notifier(edev, EXTCON_USB_HOST, + ret = devm_extcon_register_notifier(ssusb->dev, edev, EXTCON_USB_HOST, &otg_sx->id_nb); if (ret < 0) dev_err(ssusb->dev, "failed to register notifier for USB-HOST\n"); dev_dbg(ssusb->dev, "EXTCON_USB: %d, EXTCON_USB_HOST: %d\n", - extcon_get_cable_state_(edev, EXTCON_USB), - extcon_get_cable_state_(edev, EXTCON_USB_HOST)); + extcon_get_state(edev, EXTCON_USB), + extcon_get_state(edev, EXTCON_USB_HOST)); /* default as host, switch to device mode if needed */ - if (extcon_get_cable_state_(edev, EXTCON_USB_HOST) == false) + if (extcon_get_state(edev, EXTCON_USB_HOST) == false) ssusb_set_mailbox(otg_sx, MTU3_ID_FLOAT); - if (extcon_get_cable_state_(edev, EXTCON_USB) == true) + if (extcon_get_state(edev, EXTCON_USB) == true) ssusb_set_mailbox(otg_sx, MTU3_VBUS_VALID); return 0; @@ -367,13 +367,6 @@ void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb) cancel_delayed_work(&otg_sx->extcon_reg_dwork); - if (otg_sx->edev) { - extcon_unregister_notifier(otg_sx->edev, - EXTCON_USB, &otg_sx->vbus_nb); - extcon_unregister_notifier(otg_sx->edev, - EXTCON_USB_HOST, &otg_sx->id_nb); - } - if (otg_sx->manual_drd_enabled) ssusb_debugfs_exit(ssusb); }