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@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user