Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp620196ybi; Wed, 17 Jul 2019 02:14:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPtmDl/ZD1uaQVFOoQso99hoZoJTdc7sKgdZUxr+I44uD4ptMN4FnQQizGP6XtJ533NhkU X-Received: by 2002:a65:6691:: with SMTP id b17mr24595016pgw.217.1563354887219; Wed, 17 Jul 2019 02:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563354887; cv=none; d=google.com; s=arc-20160816; b=v0SAvhG8BSDv5zPtNt/veE0vzRRl/kNaPOv/TNAXrVXZKfmEbZYkto6ukSrzYmbuMk pWjyI4wyZgheZG59472TdaPe1zFnRyJmzCEYPVC2ACU0YzegQPVUodSWxalRHXP9Wl/X DgdTdsmCHggGhM6IovxHcEavwfgBDb3iJR6RwqFaP4VQtY1Js0YK4FnVVAVUi63dJP9h yxLdfHVaYMlthh+y6wOrf6oEZD+kqUPOBCAX1AqorkQu0IkYIBmJ3oTpeL2agH9d4h0O +Pz88vajS17g3tZAZa+rJ46Ew3u+Gaau3lDF5Skf8/2R8avTIWjphDpgg5a7yH5LfjM8 M0OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=7KOWMAcxr+31qoeK/dPQPubUhK70YHMptvWegEbDMIw=; b=CF9+Db7BJKxFMWB2Wh4g60bM5xLPVMdId/FzrIfrPnHfHnhsbI9GSPhrG+PpMr9fFD jlZEkdf/0o1OAPmaJfK4Wszrv++MKWIs21ChCQj6veNY23RE2Bw4rnKBAR5j81zPrw5T 9dmgF/IFDdCcB6jJRVK8BvEhZ3vsX79/KkaldrnDkFrs1v9hXzca6dgYbE9776Of6tel PE2oh8Nt/ufoczNwlpscNYWxq5LdydkPsiaL1rPyJrUb2CtS3a7MZIkQY/txSxxV5XNH ZOqz19nRvxg+UZnvkEDnekzE1tFtIZRji3Z4qnfbv8Fcqi/dbmqY5Bmu/Fb7RsKlumie Yujg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8si23693750pfv.149.2019.07.17.02.14.29; Wed, 17 Jul 2019 02:14:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729452AbfGQJOJ (ORCPT + 99 others); Wed, 17 Jul 2019 05:14:09 -0400 Received: from inva021.nxp.com ([92.121.34.21]:56192 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfGQJOG (ORCPT ); Wed, 17 Jul 2019 05:14:06 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B9973200360; Wed, 17 Jul 2019 11:14:05 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8360D2000A5; Wed, 17 Jul 2019 11:13:57 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6008C402A4; Wed, 17 Jul 2019 17:13:47 +0800 (SGT) From: Anson.Huang@nxp.com To: mpm@selenic.com, herbert@gondor.apana.org.au, arnd@arndb.de, gregkh@linuxfoundation.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, rfontana@redhat.com, allison@lohutok.net, kstewart@linuxfoundation.org, tglx@linutronix.de, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH 2/2] char: hw_random: mxc-rnga: use devm_platform_ioremap_resource() to simplify code Date: Wed, 17 Jul 2019 17:04:38 +0800 Message-Id: <20190717090438.31522-2-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190717090438.31522-1-Anson.Huang@nxp.com> References: <20190717090438.31522-1-Anson.Huang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code. Signed-off-by: Anson Huang --- drivers/char/hw_random/mxc-rnga.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c index ea2bf18..025083c 100644 --- a/drivers/char/hw_random/mxc-rnga.c +++ b/drivers/char/hw_random/mxc-rnga.c @@ -134,7 +134,6 @@ static void mxc_rnga_cleanup(struct hwrng *rng) static int __init mxc_rnga_probe(struct platform_device *pdev) { int err; - struct resource *res; struct mxc_rng *mxc_rng; mxc_rng = devm_kzalloc(&pdev->dev, sizeof(*mxc_rng), GFP_KERNEL); @@ -158,8 +157,7 @@ static int __init mxc_rnga_probe(struct platform_device *pdev) if (err) return err; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res); + mxc_rng->mem = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mxc_rng->mem)) { err = PTR_ERR(mxc_rng->mem); goto err_ioremap; -- 2.7.4