aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2013-04-18 09:43:07 -0400
committerWolfram Sang <wsa@the-dreams.de>2013-04-19 14:21:40 -0400
commitc4df5000413a667fb8c67dd5589d964cc5730d91 (patch)
treed978f3a94f1963ac236c33717ec3c3a0f6acd49e /drivers/i2c
parent08014e5424fff4017574c80c587b90a59d3573b3 (diff)
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')
-rw-r--r--drivers/i2c/busses/i2c-davinci.c19
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)
670#ifdef CONFIG_CPU_FREQ 670#ifdef CONFIG_CPU_FREQ
671 init_completion(&dev->xfr_complete); 671 init_completion(&dev->xfr_complete);
672#endif 672#endif
673 dev->dev = get_device(&pdev->dev); 673 dev->dev = &pdev->dev;
674 dev->irq = irq->start; 674 dev->irq = irq->start;
675 dev->pdata = dev->dev->platform_data; 675 dev->pdata = dev->dev->platform_data;
676 platform_set_drvdata(pdev, dev); 676 platform_set_drvdata(pdev, dev);
@@ -680,10 +680,9 @@ static int davinci_i2c_probe(struct platform_device *pdev)
680 680
681 dev->pdata = devm_kzalloc(&pdev->dev, 681 dev->pdata = devm_kzalloc(&pdev->dev,
682 sizeof(struct davinci_i2c_platform_data), GFP_KERNEL); 682 sizeof(struct davinci_i2c_platform_data), GFP_KERNEL);
683 if (!dev->pdata) { 683 if (!dev->pdata)
684 r = -ENOMEM; 684 return -ENOMEM;
685 goto err_free_mem; 685
686 }
687 memcpy(dev->pdata, &davinci_i2c_platform_data_default, 686 memcpy(dev->pdata, &davinci_i2c_platform_data_default,
688 sizeof(struct davinci_i2c_platform_data)); 687 sizeof(struct davinci_i2c_platform_data));
689 if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency", 688 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 } 693 }
695 694
696 dev->clk = devm_clk_get(&pdev->dev, NULL); 695 dev->clk = devm_clk_get(&pdev->dev, NULL);
697 if (IS_ERR(dev->clk)) { 696 if (IS_ERR(dev->clk))
698 r = -ENODEV; 697 return -ENODEV;
699 goto err_free_mem;
700 }
701 clk_prepare_enable(dev->clk); 698 clk_prepare_enable(dev->clk);
702 699
703 dev->base = devm_ioremap_resource(&pdev->dev, mem); 700 dev->base = devm_ioremap_resource(&pdev->dev, mem);
@@ -744,9 +741,6 @@ static int davinci_i2c_probe(struct platform_device *pdev)
744err_unuse_clocks: 741err_unuse_clocks:
745 clk_disable_unprepare(dev->clk); 742 clk_disable_unprepare(dev->clk);
746 dev->clk = NULL; 743 dev->clk = NULL;
747err_free_mem:
748 put_device(&pdev->dev);
749
750 return r; 744 return r;
751} 745}
752 746
@@ -757,7 +751,6 @@ static int davinci_i2c_remove(struct platform_device *pdev)
757 i2c_davinci_cpufreq_deregister(dev); 751 i2c_davinci_cpufreq_deregister(dev);
758 752
759 i2c_del_adapter(&dev->adapter); 753 i2c_del_adapter(&dev->adapter);
760 put_device(&pdev->dev);
761 754
762 clk_disable_unprepare(dev->clk); 755 clk_disable_unprepare(dev->clk);
763 dev->clk = NULL; 756 dev->clk = NULL;