Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7363504ybp; Wed, 16 Oct 2019 07:38:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRjPan+KImLi6zYgtqAx9dPMhQDuKZLbutanhTW6CCN07ERP5FwuVMeHrCxJL0X6J2wqot X-Received: by 2002:aa7:d8d5:: with SMTP id k21mr29237515eds.286.1571236713328; Wed, 16 Oct 2019 07:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571236713; cv=none; d=google.com; s=arc-20160816; b=a2PEklq1O16dhMVm/D27IMjXuZadGXUbDK4xsrJTksX8MQucNxBZbcZScs2bhWuxIk rLdjVo489rXQgdD83A0ilKzf4kZg8zO91jzkVd/13uCHgkdXQFH/daGBSne3+cVGfEct xBnhnRfGLTxT/PfWy2HTQflb5rPw+Bc9T5r6Nf/0ksV9NFT/VuG3Cqq+Qv+V/P+wTV4z RnzbAPH4hWLPnpXa9mnfC5yxcnH6Ws9Agf6c7XlIoHNZ2MTaxoZ3hRx+6HTbFSSCNIId BqoNeM+Ij2wV39lWINJTkyr55BzTffsTDSMRRWTWXklBb4fW42/qh1QHYuad4+3Snl6Q H/ew== 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=3G+OBWltR/zeLwARH+PzgvtJ1CaKyGLk63rC7vrkVW4=; b=DqrRBl4+KfhXvELBVlqp2FYkkWjGWqRrvUEnZPhSuwQ1JPT7jY0VkKyxgjl4ZTTkjl eKkroSc2vUfGZNV0NZktNl4x4TkA4kKGPGqRI3bnPrSzE4jG4DBxqzUae7rD+EqI/sWq CS9vg8bRrhdP65bO28nIq7S4lTfNNZ7gi2YAb17f+/XC0rByZY/niaJLNmFwSyuupLGl ugMKRWB8oVC5wA1cghVBR3sr/YzYV/pknXPHOgTDl48Z3zAI0ZrDivnC1ULbM2jCyJlq 6B18fxY7VndOsrye/ll9I8jOJyflW4F5tGoHPpy9pKQ0/4sVfl/zk+sWhm+9bN92Kr+d BAHQ== 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 u1si16107657ejt.143.2019.10.16.07.38.10; Wed, 16 Oct 2019 07:38:33 -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 S2404701AbfJPKrF (ORCPT + 99 others); Wed, 16 Oct 2019 06:47:05 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4186 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404688AbfJPKrC (ORCPT ); Wed, 16 Oct 2019 06:47:02 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 96F77AF0CE8A6DB49ED9; Wed, 16 Oct 2019 18:47:00 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Wed, 16 Oct 2019 18:46:50 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , CC: , , , , , , , YueHaibing Subject: [PATCH -next 07/13] hwrng: npcm - use devm_platform_ioremap_resource() to simplify code Date: Wed, 16 Oct 2019 18:46:15 +0800 Message-ID: <20191016104621.26056-8-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/npcm-rng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/npcm-rng.c b/drivers/char/hw_random/npcm-rng.c index b7c8c7e..01d0440 100644 --- a/drivers/char/hw_random/npcm-rng.c +++ b/drivers/char/hw_random/npcm-rng.c @@ -87,15 +87,13 @@ static int npcm_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) static int npcm_rng_probe(struct platform_device *pdev) { struct npcm_rng *priv; - struct resource *res; int ret; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(&pdev->dev, res); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); -- 2.7.4