Patchwork [2/3] i2c: designware-plat: drop superfluous {get|put}_device

login
register
mail settings
Submitter Wolfram Sang
Date April 18, 2013, 5:13 p.m.
Message ID <1366305218-22817-3-git-send-email-wsa@the-dreams.de>
Download mbox | patch
Permalink /patch/237698/
State Accepted
Headers show

Comments

Wolfram Sang - April 18, 2013, 5:13 p.m.
Driver core already takes care of refcounting, no need to do this on
driver level again.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |    4 ----
 1 file changed, 4 deletions(-)
Mika Westerberg - April 19, 2013, 9:46 a.m.
On Thu, Apr 18, 2013 at 07:13:37PM +0200, Wolfram Sang wrote:
> Driver core already takes care of refcounting, no need to do this on
> driver level again.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index dec939a..f7549b6 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -170,9 +170,6 @@  static int dw_i2c_probe(struct platform_device *pdev)
 	of_i2c_register_devices(adap);
 	acpi_i2c_register_devices(adap);
 
-	/* Increase reference counter */
-	get_device(&pdev->dev);
-
 	pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_set_active(&pdev->dev);
@@ -188,7 +185,6 @@  static int dw_i2c_remove(struct platform_device *pdev)
 	pm_runtime_get_sync(&pdev->dev);
 
 	i2c_del_adapter(&dev->adapter);
-	put_device(&pdev->dev);
 
 	i2c_dw_disable(dev);