From patchwork Fri Oct 13 09:10:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10003873 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 1826060325 for ; Fri, 13 Oct 2017 09:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D87F28FFE for ; Fri, 13 Oct 2017 09:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0260229005; Fri, 13 Oct 2017 09:12:56 +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,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY 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 B89ED28FFE for ; Fri, 13 Oct 2017 09:12:56 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=uWWu8Irrx3O4n1TfwMVtYFL2CFUt33pFDiYz8PSwcfc=; b=p38uAzOAqUmsX3 jcKyjLlM7dYa/QWHKEizBOWDJ3mZtSQ8lHjSlV3XHDU/6pu4/Gh5IbszeUVzJCl80oyu/kEXerkWq k61x8S2QscA3+4FmiBmIeBO/sx13qOgp3VjFb8wi23ja8tx5iGXJaSRznrFUvhirlFWP16nVkfJYh KVKXvN075ca4l+0s+8EcE5eP9k0LavMiTtY47JXPe3Y5DyrjLybzCrHl6hY4y9FCY6LccdNqhBH4a EVLQpPMxeV7h+ZD91aSoLNaGXUULcwhNnuGuvRTVHxs5dRyf3lh3WLYvHk5mN0UoNt1X8tK8iI0xw q7g30YaDzrBrsYUiskPw==; 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 1e2w1X-0007ia-G9; Fri, 13 Oct 2017 09:12:55 +0000 Received: from [218.249.47.111] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2w0A-0006Um-RU; Fri, 13 Oct 2017 09:11:39 +0000 X-UUID: c08f4dcf4b0243918e44e5ea01d1eed8-20171013 Received: from mtkcas34.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 786116178; Fri, 13 Oct 2017 17:11:09 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 13 Oct 2017 17:11:07 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 13 Oct 2017 17:11:07 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Felipe Balbi , Rob Herring Subject: [PATCH v2 09/13] usb: mtu3: set invalid dr_mode as dual-role mode Date: Fri, 13 Oct 2017 17:10:45 +0800 Message-ID: <64fa4eddb0dc3394e746eb02b5b395ee15626f86.1507885127.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <6dc39e99240f25c83f8c36d23361ec89dcfb33ce.1507885126.git.chunfeng.yun@mediatek.com> References: <6dc39e99240f25c83f8c36d23361ec89dcfb33ce.1507885126.git.chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171013_021131_596928_28A81197 X-CRM114-Status: GOOD ( 10.79 ) 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: Mark Rutland , devicetree@vger.kernel.org, Mathias Nyman , Ian Campbell , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Treat dr_mode of USB_DR_MODE_UNKNOWN as USB_DR_MODE_OTG to enhance functional robustness. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_plat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 7ca81f4e..9ff3357 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -283,10 +283,8 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) return PTR_ERR(ssusb->ippc_base); ssusb->dr_mode = usb_get_dr_mode(dev); - if (ssusb->dr_mode == USB_DR_MODE_UNKNOWN) { - dev_err(dev, "dr_mode is error\n"); - return -EINVAL; - } + if (ssusb->dr_mode == USB_DR_MODE_UNKNOWN) + ssusb->dr_mode = USB_DR_MODE_OTG; if (ssusb->dr_mode == USB_DR_MODE_PERIPHERAL) return 0;