Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7366996ybp; Wed, 16 Oct 2019 07:40:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyV/6y5PbQVix7ZxJjBHc6LXt3Y6tWvsjWjIZFongnmJdki5+uRPXUrxwPg4P4fiQ0nqNj X-Received: by 2002:a17:906:f42:: with SMTP id h2mr40019129ejj.39.1571236851395; Wed, 16 Oct 2019 07:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571236851; cv=none; d=google.com; s=arc-20160816; b=NpiYqlT3VGOcOhInQzitEatfvq+a+H1WlnqCsgEMEau9zdiTkoCcbrjqHRzKNiSEiX DFhR7STQ/sxFry9JgeBDa/wyzrWIZRmpl5HgHZ1LHjYf9alTWHlpfjEdsK7+n6x91SsZ 9wHJGZd4q+BhbJM4qPXLHzGHq6YoABULcDJRp87G6dEwhE2BOQKdRPxYTMV0nXpxuFd2 2XARY+FBtXPMKHX7h15S6DE0kfeARaoWunH0RXsZwms+AlglGYflOO0/hXsqEkrLFKAr ZMjszgsOBNCh5NCp3YHiatx0NvXziKLLU5dSw9yOeaKEKnZ+9Z8REhPXvL9Km374c5I4 aiVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=HVHnp+2lyi6Az9BALikoAMycM5+OfrFrfZMdQRkE3eo=; b=ssCpadrXAc71FE9dRw6Aa++Jm0Pe5IXsqIZrqt6fPbr3AADxBaHHtPUV14Cezsz/O8 +frkFXYOuQTOCWlYSkPE5LhhHcrYlRPWFxYHQjarnSaslYLmiZYs5NpCxoIkPpI3bMq1 zTwOSBlyxqSwZpdMh/qrNX5wRnqpWzepyiiAKr0od8oIsJKpr3Tsf4wrOr0mplbzDllt NwNGJ3nZUYzvhnVQWrRgKMr+eqGcT1PR0BkqbgV1nxFF3zoU/E6acPE4pF2JIyiD1Xwj a0H1BH3+fZsi8dS5EAL0lbYHPq7coT+LnjTM/T+fPJBCnksRDttSomaBPkuzOrd3o0F7 QF7Q== 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 d1si15282557edr.446.2019.10.16.07.40.28; Wed, 16 Oct 2019 07:40:51 -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 S2404765AbfJPKrZ (ORCPT + 99 others); Wed, 16 Oct 2019 06:47:25 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4218 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404726AbfJPKrN (ORCPT ); Wed, 16 Oct 2019 06:47:13 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9F395AB5777B958083A6; Wed, 16 Oct 2019 18:47:10 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Wed, 16 Oct 2019 18:47:04 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , CC: , , , , , , , YueHaibing Subject: [PATCH -next 13/13] hwrng: xgene - use devm_platform_ioremap_resource() to simplify code Date: Wed, 16 Oct 2019 18:46:21 +0800 Message-ID: <20191016104621.26056-14-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20191016104621.26056-1-yuehaibing@huawei.com> References: <20191016104621.26056-1-yuehaibing@huawei.com> 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/char/hw_random/xgene-rng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/xgene-rng.c b/drivers/char/hw_random/xgene-rng.c index 7e568db..d7516a4 100644 --- a/drivers/char/hw_random/xgene-rng.c +++ b/drivers/char/hw_random/xgene-rng.c @@ -313,7 +313,6 @@ static struct hwrng xgene_rng_func = { static int xgene_rng_probe(struct platform_device *pdev) { - struct resource *res; struct xgene_rng_dev *ctx; int rc = 0; @@ -324,8 +323,7 @@ static int xgene_rng_probe(struct platform_device *pdev) ctx->dev = &pdev->dev; platform_set_drvdata(pdev, ctx); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ctx->csr_base = devm_ioremap_resource(&pdev->dev, res); + ctx->csr_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ctx->csr_base)) return PTR_ERR(ctx->csr_base); -- 2.7.4