mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
spi: ath79: simplify iomem resource mapping
Simplify the code by switching from devm_ioremap to devm_ioremap_resource. Checking the result of platform_get_resource is not needed as devm_ioremap_resource checks the provided resource argument for NULL. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6ff33f3902
commit
b7a2a1c0b6
@ -240,14 +240,9 @@ static int ath79_spi_probe(struct platform_device *pdev)
|
||||
sp->bitbang.flags = SPI_CS_HIGH;
|
||||
|
||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (r == NULL) {
|
||||
ret = -ENOENT;
|
||||
goto err_put_master;
|
||||
}
|
||||
|
||||
sp->base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
|
||||
if (!sp->base) {
|
||||
ret = -ENXIO;
|
||||
sp->base = devm_ioremap_resource(&pdev->dev, r);
|
||||
if (IS_ERR(sp->base)) {
|
||||
ret = PTR_ERR(sp->base);
|
||||
goto err_put_master;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user