diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-10 08:33:40 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2023-08-14 18:09:30 +0200 |
commit | 0a310eef70c0a9d9c956e1b532c9505e6952d1b0 (patch) | |
tree | 4ba2817ef1442361516b176617f99b80f2dbd852 /drivers/i2c/busses | |
parent | I2C: Explicitly include correct DT includes (diff) | |
download | linux-0a310eef70c0a9d9c956e1b532c9505e6952d1b0.tar.xz linux-0a310eef70c0a9d9c956e1b532c9505e6952d1b0.zip |
i2c: at91: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-at91-core.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index 3563a7fd75db..91d66ec14588 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -206,19 +206,15 @@ static int at91_twi_probe(struct platform_device *pdev) dev->dev = &pdev->dev; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem) - return -ENODEV; + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); + if (IS_ERR(dev->base)) + return PTR_ERR(dev->base); phy_addr = mem->start; dev->pdata = at91_twi_get_driver_data(pdev); if (!dev->pdata) return -ENODEV; - dev->base = devm_ioremap_resource(&pdev->dev, mem); - if (IS_ERR(dev->base)) - return PTR_ERR(dev->base); - dev->irq = platform_get_irq(pdev, 0); if (dev->irq < 0) return dev->irq; |