hwspinlock: stm32: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Link: https://lore.kernel.org/r/20191228191541.26999-1-tiny.windzz@gmail.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
8875b1d242
commit
d4824486b6
|
@ -58,12 +58,10 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct stm32_hwspinlock *hw;
|
||||
void __iomem *io_base;
|
||||
struct resource *res;
|
||||
size_t array_size;
|
||||
int i, ret;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
io_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
io_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(io_base))
|
||||
return PTR_ERR(io_base);
|
||||
|
||||
|
|
Loading…
Reference in New Issue