Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7359747ybp; Wed, 16 Oct 2019 07:35:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlR5weJREDrcTxvP+a+my5eMXFaz73W9/cqGCCVQx7F5VlLOA8ZP0OBLh0sp+SoUXYpJ8u X-Received: by 2002:aa7:dc47:: with SMTP id g7mr39640908edu.153.1571236545827; Wed, 16 Oct 2019 07:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571236545; cv=none; d=google.com; s=arc-20160816; b=Tc/g+jSMsaJWL/zmEf5PwBpK5r4GadQLLoRAJ02zEpxUoxiNq7/jp7+lpjmkr6DG/I qmE6sjjPe6MLqLVJJ4lMQTyGUBZLU1DkJyLUMSlMnsVGXe0qqzabKs6lmCVBRvD2nyMZ Odb3o6FPmcpLft7Tdrj87RcMPAGfeL4Co/fyD1D7WqyDz3kfW+7HqhX0pW4omAgQ62x0 qB5iQFxDkW3fu0YuFRHp6eddRup0BCxtYHuu3+8VMUKfgosR4EyaxOpUqFk02JpZc24U AhMLmJnviNZYSQKGuthyhO1poksGaOPilcvfbAW7NEMv8WaMpgu6zlePOyrapD5WGx+l oGtg== 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=d4tUKGAS9bYcZnyYsrVTNe2Akivk0Hj4ME2CZGD03yQ=; b=dv8NvnTfDWUXDCna/y8pyi5Bip44yH6olW6P2AshTOsRG9E5V8+1uvNQ3X7uTUXKod 8yX9Mhj+56bc7mR1syxHiQdk54QbWGmwWcOETCPih181D8LH8QA/0TxV32nHK3Mg8vyy 7umuUd3kB+2Hm+9isaggztBvEkrWLGx2SEg5Q7Dc1pR+g/5WN5na92hBxcnaDPB3Qz5J xPAaVBvfA0huIoHfkLnNwTyLVgu/xM0uB1hoPZPhp6KI7dAuraZ8Csei/JNh/Z/PLNZa qtRcjXgyZfmWqdzek7vzmb23uVT8ozGzM2KUcdAKjCyhbURQXK+vCMXaO7SpxZHfKSI+ q3jw== 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 u8si17502262edb.57.2019.10.16.07.35.21; Wed, 16 Oct 2019 07:35:45 -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 S2404662AbfJPKq5 (ORCPT + 99 others); Wed, 16 Oct 2019 06:46:57 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43814 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2392494AbfJPKqu (ORCPT ); Wed, 16 Oct 2019 06:46:50 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6BC042E696B294CD8DC3; Wed, 16 Oct 2019 18:46:49 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Wed, 16 Oct 2019 18:46:39 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , CC: , , , , , , , YueHaibing Subject: [PATCH -next 02/13] hwrng: bcm2835 - use devm_platform_ioremap_resource() to simplify code Date: Wed, 16 Oct 2019 18:46:10 +0800 Message-ID: <20191016104621.26056-3-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/bcm2835-rng.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c index f759790..d2a5791 100644 --- a/drivers/char/hw_random/bcm2835-rng.c +++ b/drivers/char/hw_random/bcm2835-rng.c @@ -142,7 +142,6 @@ static int bcm2835_rng_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; const struct of_device_id *rng_id; struct bcm2835_rng_priv *priv; - struct resource *r; int err; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -151,10 +150,8 @@ static int bcm2835_rng_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - /* map peripheral */ - priv->base = devm_ioremap_resource(dev, r); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); -- 2.7.4