提交 f16c1408 编写于 作者: C chenqiwu 提交者: Wolfram Sang

i2c: omap: use devm_platform_ioremap_resource()

Use a new API devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Nchenqiwu <chenqiwu@xiaomi.com>
Tested-by: NLuca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: NLuca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 6b060d8a
......@@ -1355,7 +1355,6 @@ omap_i2c_probe(struct platform_device *pdev)
{
struct omap_i2c_dev *omap;
struct i2c_adapter *adap;
struct resource *mem;
const struct omap_i2c_bus_platform_data *pdata =
dev_get_platdata(&pdev->dev);
struct device_node *node = pdev->dev.of_node;
......@@ -1375,8 +1374,7 @@ omap_i2c_probe(struct platform_device *pdev)
if (!omap)
return -ENOMEM;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
omap->base = devm_ioremap_resource(&pdev->dev, mem);
omap->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(omap->base))
return PTR_ERR(omap->base);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册