From patchwork Wed Sep 4 09:32:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 11129807 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 BBA1816B1 for ; Wed, 4 Sep 2019 09:33:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7346206A3 for ; Wed, 4 Sep 2019 09:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729415AbfIDJc5 (ORCPT ); Wed, 4 Sep 2019 05:32:57 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44976 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725840AbfIDJc5 (ORCPT ); Wed, 4 Sep 2019 05:32:57 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E6614287EB2AD6177276; Wed, 4 Sep 2019 17:32:55 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 17:32:47 +0800 From: YueHaibing To: , , , CC: , , , , YueHaibing Subject: [PATCH -next] usb: gadget: bcm63xx_udc: use devm_platform_ioremap_resource() to simplify code Date: Wed, 4 Sep 2019 17:32:27 +0800 Message-ID: <20190904093227.23304-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/bcm63xx_udc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 97b1646..7fcf4a8 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -2282,7 +2282,6 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct bcm63xx_usbd_platform_data *pd = dev_get_platdata(dev); struct bcm63xx_udc *udc; - struct resource *res; int rc = -ENOMEM, i, irq; udc = devm_kzalloc(dev, sizeof(*udc), GFP_KERNEL); @@ -2298,13 +2297,11 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) return -EINVAL; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - udc->usbd_regs = devm_ioremap_resource(dev, res); + udc->usbd_regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(udc->usbd_regs)) return PTR_ERR(udc->usbd_regs); - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - udc->iudma_regs = devm_ioremap_resource(dev, res); + udc->iudma_regs = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(udc->iudma_regs)) return PTR_ERR(udc->iudma_regs);