Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: bcm63xx-hsspi: 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>
Link: https://lore.kernel.org/r/20190904135918.25352-8-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

YueHaibing and committed by
Mark Brown
e364c8c2 6ba794df

+1 -3
+1 -3
drivers/spi/spi-bcm63xx-hsspi.c
··· 330 330 { 331 331 struct spi_master *master; 332 332 struct bcm63xx_hsspi *bs; 333 - struct resource *res_mem; 334 333 void __iomem *regs; 335 334 struct device *dev = &pdev->dev; 336 335 struct clk *clk, *pll_clk = NULL; ··· 340 341 if (irq < 0) 341 342 return irq; 342 343 343 - res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 344 - regs = devm_ioremap_resource(dev, res_mem); 344 + regs = devm_platform_ioremap_resource(pdev, 0); 345 345 if (IS_ERR(regs)) 346 346 return PTR_ERR(regs); 347 347