From patchwork Wed Sep 27 09:22:57 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: 9973569 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 384466037F for ; Wed, 27 Sep 2017 09:25:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C6CA2912D for ; Wed, 27 Sep 2017 09:25:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 312652913E; Wed, 27 Sep 2017 09:25:11 +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 B58F229153 for ; Wed, 27 Sep 2017 09:25:08 +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: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:References: List-Owner; bh=5RFCQT1rpW8H2hISF5EGi01Qxs2uyXkguZ+nJ7kgbtw=; b=OQLBBsYOiV5Qpi o2lT7H35J9jnIwi99cY3pCv9FFyXdChMys4VT69RWH2yzWu6Hf6sg5gALCUwuMGy6q2LG+RuHe83r GU3n0g8o3KLydJ8tgrat/SAm3ZmGG85jpgGFMnFsk0bzgAAIz4yVc//YVw6elMr3WxMauuD7Zi5p/ l/ydI0jUWX1V7o9UPJZbPl/uLlQmzlsw38Tr64kb313G+YpBir/Q/BTcxBIY0/yAXs0rE69UBgSMY YNUodOd8rhNUJGDfHmhpn7xkOlQQHTT+YL23Y+CKNDdimSUOlY91CJhS14fJftmJEXXmMYLvMBzWq E7dVNM7R+NIjX0sVj1jg==; 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 1dx8aH-0007ta-Le; Wed, 27 Sep 2017 09:24:49 +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 1dx8ZG-0005Wx-UB; Wed, 27 Sep 2017 09:23:52 +0000 X-UUID: 28a581efcc8747a3b72732fb530e063a-20170927 Received: from mtkcas36.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 133226795; Wed, 27 Sep 2017 17:23:01 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 27 Sep 2017 17:22:56 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Wed, 27 Sep 2017 17:23:00 +0800 From: Chunfeng Yun To: Mathias Nyman , Greg Kroah-Hartman , Felipe Balbi , Rob Herring Subject: [PATCH 1/9] usb: xhci-mtk: use dma_set_mask_and_coherent() in probe function Date: Wed, 27 Sep 2017 17:22:57 +0800 Message-ID: <994382d16d6bdc0f3d7c11b22f1710252e056e34.1506503879.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170927_022349_441140_E22B84E0 X-CRM114-Status: GOOD ( 10.15 ) 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, 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 This patch uses the simpler dma_set_mask_and_coherent() instead of doing these as separate steps Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 8fb6065..c197a6d 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -606,15 +606,10 @@ static int xhci_mtk_probe(struct platform_device *pdev) } /* Initialize dma_mask and coherent_dma_mask to 32-bits */ - ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); if (ret) goto disable_clk; - if (!dev->dma_mask) - dev->dma_mask = &dev->coherent_dma_mask; - else - dma_set_mask(dev, DMA_BIT_MASK(32)); - hcd = usb_create_hcd(driver, dev, dev_name(dev)); if (!hcd) { ret = -ENOMEM;