Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1127732ybe; Fri, 6 Sep 2019 12:16:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5xQHul5fYXMwV3zAP8m38tDzFVaaV8S2f53nUpHO4N38r+9TXnKeLXj9ia9ikboyH12TB X-Received: by 2002:a17:90a:266c:: with SMTP id l99mr11436914pje.93.1567797377375; Fri, 06 Sep 2019 12:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567797377; cv=none; d=google.com; s=arc-20160816; b=LX+CCIkGYv4gKWaxNM29bDZVHwe258u58qk5HZh4UiIPC8EqXfqVrxlErUY5/8uLKK RS/SMrlCK9ZfgfRaEbDADu1OZJKtu2wQfuF1kCsguuxAG6G0v6ku9ucL2azIgoB5Xjw3 v08MsvBxd6q2HmLmY59M1JhqKaiejzR1EGUbvnvdL4kSgwIbS7KnF/NTilxLkc/Tpe5U O00RMKn2ZE2dnrUNXgwmVettPgiegrfm2kqn1z2Bd1iWj903RffLQcAYFDgwkKPYVaIP eMhOli6UBUK5xOioLqb3kzhlCFNGDODrVix/c4DhIFCmJJIRpugp7hW0n96NoH9v1DBx HpkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=jK6C7oeNros4wmDj/7hXdbdNTFVEerDR/wUs0KysQNc=; b=KUjpnAp2YfewMfjcKeXpL6ykXEwQiaytPa3ul5lpX+gZelbmnaepkco3sZwy9cyI6X jcEo5Hp0/PaiNThMzTP3171ANMMziuWVTxIBCF1M/YpP5MJ6ZT4kGKfZoWQhKH5Oj0oh RFMDvRQHBc7lJEx55TTNi9XeaTNPyzLQGyQ1FDtb5DtdC4VISl1xNDdAPqTdDBcPWDpI 9X/lB/iW/FHBBRuUhHQJIYoo94RNc6Ty4Mu8K6RLYn5jMIdbzsYNL5lUGfA2sfNu+a4o rR8I0Vdu+0qitlOwVPwc5S9WuRusVdTBBk2xoS3qhW6fRDpmLWix+LNMDllib2iaJl3l /gBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9si5353432plo.192.2019.09.06.12.16.01; Fri, 06 Sep 2019 12:16:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394270AbfIFORs (ORCPT + 99 others); Fri, 6 Sep 2019 10:17:48 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:41046 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2392868AbfIFORs (ORCPT ); Fri, 6 Sep 2019 10:17:48 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 893DF1D8CAAEA04C5933; Fri, 6 Sep 2019 22:17:45 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Sep 2019 22:17:36 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH -next] RDMA/hns: use devm_platform_ioremap_resource() to simplify code Date: Fri, 6 Sep 2019 22:17:27 +0800 Message-ID: <20190906141727.26552-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing --- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index dc9a1cd..5f74bf5 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c @@ -4511,7 +4511,6 @@ static int hns_roce_get_cfg(struct hns_roce_dev *hr_dev) struct platform_device *pdev = NULL; struct net_device *netdev = NULL; struct device_node *net_node; - struct resource *res; int port_cnt = 0; u8 phy_port; int ret; @@ -4550,8 +4549,7 @@ static int hns_roce_get_cfg(struct hns_roce_dev *hr_dev) } /* get the mapped register base address */ - res = platform_get_resource(hr_dev->pdev, IORESOURCE_MEM, 0); - hr_dev->reg_base = devm_ioremap_resource(dev, res); + hr_dev->reg_base = devm_platform_ioremap_resource(hr_dev->pdev, 0); if (IS_ERR(hr_dev->reg_base)) return PTR_ERR(hr_dev->reg_base); -- 2.7.4