diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2013-04-18 17:43:07 +0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2013-04-19 22:21:40 +0400 |
commit | c4df5000413a667fb8c67dd5589d964cc5730d91 (patch) | |
tree | d978f3a94f1963ac236c33717ec3c3a0f6acd49e /drivers/i2c/busses/i2c-davinci.c | |
parent | 08014e5424fff4017574c80c587b90a59d3573b3 (diff) | |
download | linux-c4df5000413a667fb8c67dd5589d964cc5730d91.tar.xz |
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: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/i2c/busses/i2c-davinci.c')
-rw-r--r-- | drivers/i2c/busses/i2c-davinci.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index c01edacbfe33..cf20e06a88e1 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -670,7 +670,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) #ifdef CONFIG_CPU_FREQ init_completion(&dev->xfr_complete); #endif - dev->dev = get_device(&pdev->dev); + dev->dev = &pdev->dev; dev->irq = irq->start; dev->pdata = dev->dev->platform_data; platform_set_drvdata(pdev, dev); @@ -680,10 +680,9 @@ static int davinci_i2c_probe(struct platform_device *pdev) dev->pdata = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_platform_data), GFP_KERNEL); - if (!dev->pdata) { - r = -ENOMEM; - goto err_free_mem; - } + if (!dev->pdata) + return -ENOMEM; + memcpy(dev->pdata, &davinci_i2c_platform_data_default, sizeof(struct davinci_i2c_platform_data)); if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency", @@ -694,10 +693,8 @@ static int davinci_i2c_probe(struct platform_device *pdev) } dev->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(dev->clk)) { - r = -ENODEV; - goto err_free_mem; - } + if (IS_ERR(dev->clk)) + return -ENODEV; clk_prepare_enable(dev->clk); dev->base = devm_ioremap_resource(&pdev->dev, mem); @@ -744,9 +741,6 @@ static int davinci_i2c_probe(struct platform_device *pdev) err_unuse_clocks: clk_disable_unprepare(dev->clk); dev->clk = NULL; -err_free_mem: - put_device(&pdev->dev); - return r; } @@ -757,7 +751,6 @@ static int davinci_i2c_remove(struct platform_device *pdev) i2c_davinci_cpufreq_deregister(dev); i2c_del_adapter(&dev->adapter); - put_device(&pdev->dev); clk_disable_unprepare(dev->clk); dev->clk = NULL; |