Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7366679ybp; Wed, 16 Oct 2019 07:40:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmmsCBCUAAdfPuaKqegTGiLvNbpb28M2L66VnOaVdD2le6xTFk+Jfp5mixy1f+Z8KnVXE/ X-Received: by 2002:a50:f395:: with SMTP id g21mr38731892edm.223.1571236839348; Wed, 16 Oct 2019 07:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571236839; cv=none; d=google.com; s=arc-20160816; b=zqHO5zEvRnkzHG6ZcUYJyUo+647EJg8OsZuIhn7r1ulamxYNtNU/kcH60GCFrl6skU zRhjzUipUtqyshLE44WPaDF60jw3qZP7syXrAzAKK6jKNaZqbL4q7HGyHPts+FNsJ/Cp UgmkuPL42ORkwMfAljfGe4k0e2vqca8pPNUk3yjznkYH5RNv/fe/h2pYabhcKP5pfrHY is0TjLP8UYYB7u7N9h9X4mIOJxAaFL7IQ4zYkWhKFnrQXqd1qJrCSB0h264yQ6b6eiDF Oe3PXkm/YtGu6oB8PzjgUBLoC8DSUha9cY1nZYUZlrBLbPZxgKixzeFuhRWPHVUw2fuV yX1Q== 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=O9/J1djSdoI4gMo4DHzJN/7Et8bQ7gDfsz3lPhbqRYU=; b=nrcozx7G42UtZrfU71oLZ2Tkx1SAPdYOUYcsCgeUPWV2Y9Am8x7PLOhq+MsfGCgsrx YhzBO7hS0tuaz9/DCr/xf4rEItvZZqpHIPFXwQVLy8bMbb7819zoVb9Xy9d3e1qQMJks eSsOCqQL7rZ5vvKMW4Du5c5hFh4g62AdRvE4Ydil0AgcxvJBYrvoYV/8XmHyNXCMOioR IWHnVkVuzXtZKsj/BuVVcvQvrqE0JXZMgFLNDz+7+TrnfCa4lXWMez8I39NrbKGL1din KpbW2SlMZw6nbONIMkvx2a/F92kBBzSUi0nqCAe7AkQxM8Di2M1F+RTNcvz36tSebotw vgMA== 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 e7si15688090ejk.20.2019.10.16.07.40.15; Wed, 16 Oct 2019 07:40:39 -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 S2404752AbfJPKrR (ORCPT + 99 others); Wed, 16 Oct 2019 06:47:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4188 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404733AbfJPKrO (ORCPT ); Wed, 16 Oct 2019 06:47:14 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6BAF4D1C02086EA536F6; Wed, 16 Oct 2019 18:47:11 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Wed, 16 Oct 2019 18:47:02 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , CC: , , , , , , , YueHaibing Subject: [PATCH -next 12/13] hwrng: tx4939 - use devm_platform_ioremap_resource() to simplify code Date: Wed, 16 Oct 2019 18:46:20 +0800 Message-ID: <20191016104621.26056-13-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/tx4939-rng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/tx4939-rng.c b/drivers/char/hw_random/tx4939-rng.c index 1093583..c8bd34e 100644 --- a/drivers/char/hw_random/tx4939-rng.c +++ b/drivers/char/hw_random/tx4939-rng.c @@ -107,14 +107,12 @@ static int tx4939_rng_data_read(struct hwrng *rng, u32 *buffer) static int __init tx4939_rng_probe(struct platform_device *dev) { struct tx4939_rng *rngdev; - struct resource *r; int i; rngdev = devm_kzalloc(&dev->dev, sizeof(*rngdev), GFP_KERNEL); if (!rngdev) return -ENOMEM; - r = platform_get_resource(dev, IORESOURCE_MEM, 0); - rngdev->base = devm_ioremap_resource(&dev->dev, r); + rngdev->base = devm_platform_ioremap_resource(dev, 0); if (IS_ERR(rngdev->base)) return PTR_ERR(rngdev->base); -- 2.7.4