diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-09-22 19:42:25 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-09-23 22:02:24 +0200 |
commit | 05a27928f37b31ea8b844e3b0c623d7f46451145 (patch) | |
tree | db5fc17aebd75a8fc5b7fde813d8b14ad0c7f3fe | |
parent | crypto: move x86 to the generic version of ablk_helper (diff) | |
download | linux-05a27928f37b31ea8b844e3b0c623d7f46451145.tar.xz linux-05a27928f37b31ea8b844e3b0c623d7f46451145.zip |
crypto: dcp - Use devm_ioremap_resource()
Using devm_ioremap_resource() can make the code simpler and smaller.
When devm_ioremap_resource() is used there is no need to explicitely check the
error returned by platform_get_resource().
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/dcp.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/crypto/dcp.c b/drivers/crypto/dcp.c index a8a7dd4b0d25..90a7cb7fdc9d 100644 --- a/drivers/crypto/dcp.c +++ b/drivers/crypto/dcp.c @@ -733,12 +733,7 @@ static int dcp_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dev); r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!r) { - dev_err(&pdev->dev, "failed to get IORESOURCE_MEM\n"); - return -ENXIO; - } - dev->dcp_regs_base = devm_ioremap(&pdev->dev, r->start, - resource_size(r)); + dev->dcp_regs_base = devm_ioremap_resource(&pdev->dev, r); dcp_set(dev, DCP_CTRL_SFRST, DCP_REG_CTRL); udelay(10); |