Commit c4df5000 authored by Wolfram Sang's avatar Wolfram Sang

i2c: davinci: drop superfluous {get|put}_device

Driver core already takes care of refcounting, no need to do this on
driver level again.
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Tested-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 08014e54
...@@ -670,7 +670,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) ...@@ -670,7 +670,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
init_completion(&dev->xfr_complete); init_completion(&dev->xfr_complete);
#endif #endif
dev->dev = get_device(&pdev->dev); dev->dev = &pdev->dev;
dev->irq = irq->start; dev->irq = irq->start;
dev->pdata = dev->dev->platform_data; dev->pdata = dev->dev->platform_data;
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
...@@ -680,10 +680,9 @@ static int davinci_i2c_probe(struct platform_device *pdev) ...@@ -680,10 +680,9 @@ static int davinci_i2c_probe(struct platform_device *pdev)
dev->pdata = devm_kzalloc(&pdev->dev, dev->pdata = devm_kzalloc(&pdev->dev,
sizeof(struct davinci_i2c_platform_data), GFP_KERNEL); sizeof(struct davinci_i2c_platform_data), GFP_KERNEL);
if (!dev->pdata) { if (!dev->pdata)
r = -ENOMEM; return -ENOMEM;
goto err_free_mem;
}
memcpy(dev->pdata, &davinci_i2c_platform_data_default, memcpy(dev->pdata, &davinci_i2c_platform_data_default,
sizeof(struct davinci_i2c_platform_data)); sizeof(struct davinci_i2c_platform_data));
if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency", if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency",
...@@ -694,10 +693,8 @@ static int davinci_i2c_probe(struct platform_device *pdev) ...@@ -694,10 +693,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
} }
dev->clk = devm_clk_get(&pdev->dev, NULL); dev->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(dev->clk)) { if (IS_ERR(dev->clk))
r = -ENODEV; return -ENODEV;
goto err_free_mem;
}
clk_prepare_enable(dev->clk); clk_prepare_enable(dev->clk);
dev->base = devm_ioremap_resource(&pdev->dev, mem); dev->base = devm_ioremap_resource(&pdev->dev, mem);
...@@ -744,9 +741,6 @@ static int davinci_i2c_probe(struct platform_device *pdev) ...@@ -744,9 +741,6 @@ static int davinci_i2c_probe(struct platform_device *pdev)
err_unuse_clocks: err_unuse_clocks:
clk_disable_unprepare(dev->clk); clk_disable_unprepare(dev->clk);
dev->clk = NULL; dev->clk = NULL;
err_free_mem:
put_device(&pdev->dev);
return r; return r;
} }
...@@ -757,7 +751,6 @@ static int davinci_i2c_remove(struct platform_device *pdev) ...@@ -757,7 +751,6 @@ static int davinci_i2c_remove(struct platform_device *pdev)
i2c_davinci_cpufreq_deregister(dev); i2c_davinci_cpufreq_deregister(dev);
i2c_del_adapter(&dev->adapter); i2c_del_adapter(&dev->adapter);
put_device(&pdev->dev);
clk_disable_unprepare(dev->clk); clk_disable_unprepare(dev->clk);
dev->clk = NULL; dev->clk = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment