From patchwork Wed Sep 4 09:33:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 11129811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 691551395 for ; Wed, 4 Sep 2019 09:36:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53C9721670 for ; Wed, 4 Sep 2019 09:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727929AbfIDJgU (ORCPT ); Wed, 4 Sep 2019 05:36:20 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6639 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726304AbfIDJgU (ORCPT ); Wed, 4 Sep 2019 05:36:20 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 43C66A80CBE103D201F1; Wed, 4 Sep 2019 17:36:18 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 17:36:09 +0800 From: YueHaibing To: , , , , CC: , Subject: [PATCH -next] usb: bdc: use devm_platform_ioremap_resource() to simplify code Date: Wed, 4 Sep 2019 17:33:35 +0800 Message-ID: <20190904093335.22860-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/usb/gadget/udc/bdc/bdc_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index cc4a16e..02a3a77 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -480,7 +480,6 @@ static void bdc_phy_exit(struct bdc *bdc) static int bdc_probe(struct platform_device *pdev) { struct bdc *bdc; - struct resource *res; int ret = -ENOMEM; int irq; u32 temp; @@ -508,8 +507,7 @@ static int bdc_probe(struct platform_device *pdev) bdc->clk = clk; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - bdc->regs = devm_ioremap_resource(dev, res); + bdc->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(bdc->regs)) { dev_err(dev, "ioremap error\n"); return -ENOMEM;