[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190802132809.8116-11-yuehaibing@huawei.com>
Date: Fri, 2 Aug 2019 21:28:07 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <herbert@...dor.apana.org.au>, <lars.persson@...s.com>,
<jesper.nilsson@...s.com>, <davem@...emloft.net>,
<thomas.lendacky@....com>, <gary.hook@....com>, <krzk@...nel.org>,
<kgene@...nel.org>, <antoine.tenart@...tlin.com>,
<matthias.bgg@...il.com>, <jamie@...ieiles.com>,
<agross@...nel.org>, <heiko@...ech.de>,
<mcoquelin.stm32@...il.com>, <alexandre.torgue@...com>,
<clabbe.montjoie@...il.com>, <mripard@...nel.org>, <wens@...e.org>
CC: <linux-kernel@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<linux-arm-kernel@...s.com>, <linux-samsung-soc@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-arm-msm@...r.kernel.org>,
<linux-rockchip@...ts.infradead.org>,
<linux-stm32@...md-mailman.stormreply.com>,
YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH -next 10/12] crypto: stm32 - use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
drivers/crypto/stm32/stm32-crc32.c | 4 +---
drivers/crypto/stm32/stm32-cryp.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/stm32/stm32-crc32.c b/drivers/crypto/stm32/stm32-crc32.c
index 440c9f1..9e11c34 100644
--- a/drivers/crypto/stm32/stm32-crc32.c
+++ b/drivers/crypto/stm32/stm32-crc32.c
@@ -255,7 +255,6 @@ static int stm32_crc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct stm32_crc *crc;
- struct resource *res;
int ret;
crc = devm_kzalloc(dev, sizeof(*crc), GFP_KERNEL);
@@ -264,8 +263,7 @@ static int stm32_crc_probe(struct platform_device *pdev)
crc->dev = dev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- crc->regs = devm_ioremap_resource(dev, res);
+ crc->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(crc->regs)) {
dev_err(dev, "Cannot map CRC IO\n");
return PTR_ERR(crc->regs);
diff --git a/drivers/crypto/stm32/stm32-cryp.c b/drivers/crypto/stm32/stm32-cryp.c
index 98ae028..2fe6f26 100644
--- a/drivers/crypto/stm32/stm32-cryp.c
+++ b/drivers/crypto/stm32/stm32-cryp.c
@@ -1955,7 +1955,6 @@ static int stm32_cryp_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct stm32_cryp *cryp;
- struct resource *res;
struct reset_control *rst;
int irq, ret;
@@ -1969,8 +1968,7 @@ static int stm32_cryp_probe(struct platform_device *pdev)
cryp->dev = dev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- cryp->regs = devm_ioremap_resource(dev, res);
+ cryp->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(cryp->regs))
return PTR_ERR(cryp->regs);
--
2.7.4
Powered by blists - more mailing lists