i2c: omap: use devm_platform_ioremap_resource()

Use a new API devm_platform_ioremap_resource() to simplify code.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
chenqiwu 2020-02-15 16:36:43 +08:00 коммит произвёл Wolfram Sang
Родитель 6b060d8a09
Коммит f16c140810
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -1355,7 +1355,6 @@ omap_i2c_probe(struct platform_device *pdev)
{ {
struct omap_i2c_dev *omap; struct omap_i2c_dev *omap;
struct i2c_adapter *adap; struct i2c_adapter *adap;
struct resource *mem;
const struct omap_i2c_bus_platform_data *pdata = const struct omap_i2c_bus_platform_data *pdata =
dev_get_platdata(&pdev->dev); dev_get_platdata(&pdev->dev);
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
@ -1375,8 +1374,7 @@ omap_i2c_probe(struct platform_device *pdev)
if (!omap) if (!omap)
return -ENOMEM; return -ENOMEM;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); omap->base = devm_platform_ioremap_resource(pdev, 0);
omap->base = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(omap->base)) if (IS_ERR(omap->base))
return PTR_ERR(omap->base); return PTR_ERR(omap->base);