Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7370349ybp; Wed, 16 Oct 2019 07:43:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyw0VHwrs3ZIShMU1EA1eFImcBYqusMjxMe1zr+1B2mI5j2gU5F33oLSV6XbrGOw0VhGT2G X-Received: by 2002:aa7:d28d:: with SMTP id w13mr38947385edq.184.1571237003413; Wed, 16 Oct 2019 07:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571237003; cv=none; d=google.com; s=arc-20160816; b=sHj7JDX42NWYqWh5xw8+f68NNtgKKnj0v026E/EL0mCdZ3jmU/Xdnxm8fGTS/uf37C DcYYTrHYh28/Lu+iGZJGRULPaDGTtn07N0w7kxuef2y3XQ076YpbNCyDs2FtwXxSF4p2 oLdbjoyixNHh8omIDdPDWrXKXp8b3CshcaN3aeW4vE1nb4mD709lklc/XN5XRVYJSYA1 Oo2QV71Rb+gjXG5Qtsop+whbqHT27h1DbPXEfCne+Z1XfH4Iw2q/wYGPReBtAEeb2Hsc plm4rIAZwFtx3XePDUYCUN+d78WewiJsrHFKVvTFopygP006K1U5VrQTU2N5JvCcuorq yGiA== 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=FamzbLiORrN/1pgTV78MyZPpZVR79AdqwkYDughdURE=; b=txy8+iQGl8PesjuPzwylgzT1bleyMdS/MoK3pDDm0aNjJtEK5rSA+IH4796Us3w6Dh uS5wAUIcDd0XG3h1hoIk3kT0inF7HWBcY2j8WDguO68DORzwiLhv79T4nWLs9M3F92bl eQV2JP/zkkfnkkOgCZS/jcfsLe8Lqziba230NdquHqmyOQetXRn6+f2t795smh066kIR PNQSzLWfL8p6MGoMLsZg7vGCZL+EbJyJ/d1D02qeWyDu1w1GjJEFl5BY2JmSZzkdkjuw GH7KdcuEniqLr+j/RuXoXq4mjSek/Y3Dh1nA5BdoSzi66OqUBQSc7bXgXkwolT49VypN N2tA== 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 w12si15896895ejb.303.2019.10.16.07.42.59; Wed, 16 Oct 2019 07:43:23 -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 S2404673AbfJPKq6 (ORCPT + 99 others); Wed, 16 Oct 2019 06:46:58 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44064 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727291AbfJPKqx (ORCPT ); Wed, 16 Oct 2019 06:46:53 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 86ECA4684DCFA3037407; Wed, 16 Oct 2019 18:46:51 +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, 16 Oct 2019 18:46:45 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , CC: , , , , , , , YueHaibing Subject: [PATCH -next 05/13] hwrng: ks-sa - use devm_platform_ioremap_resource() to simplify code Date: Wed, 16 Oct 2019 18:46:13 +0800 Message-ID: <20191016104621.26056-6-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/ks-sa-rng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/ks-sa-rng.c b/drivers/char/hw_random/ks-sa-rng.c index a674300..556400a 100644 --- a/drivers/char/hw_random/ks-sa-rng.c +++ b/drivers/char/hw_random/ks-sa-rng.c @@ -174,7 +174,6 @@ static int ks_sa_rng_probe(struct platform_device *pdev) struct ks_sa_rng *ks_sa_rng; struct device *dev = &pdev->dev; int ret; - struct resource *mem; ks_sa_rng = devm_kzalloc(dev, sizeof(*ks_sa_rng), GFP_KERNEL); if (!ks_sa_rng) @@ -190,8 +189,7 @@ static int ks_sa_rng_probe(struct platform_device *pdev) }; ks_sa_rng->rng.priv = (unsigned long)dev; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ks_sa_rng->reg_rng = devm_ioremap_resource(dev, mem); + ks_sa_rng->reg_rng = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ks_sa_rng->reg_rng)) return PTR_ERR(ks_sa_rng->reg_rng); -- 2.7.4