Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: davinci: preparation for switch to common clock framework

As a first step towards migrating davinci platforms to use common clock
framework, replace all instances of clk_enable() with clk_prepare_enable()
and clk_disable() with clk_disable_unprepare(). Until the platform is
switched to use the CONFIG_HAVE_CLK_PREPARE Kconfig variable, this just
adds a might_sleep() call and would work without any issues.

This will make it easy later to switch to common clk based implementation
of clk driver from DaVinci specific driver.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>

authored by

Murali Karicheri and committed by
Wolfram Sang
2bdbfa9c c5d3cd6d

+5 -5
+5 -5
drivers/i2c/busses/i2c-davinci.c
··· 704 704 r = -ENODEV; 705 705 goto err_free_mem; 706 706 } 707 - clk_enable(dev->clk); 707 + clk_prepare_enable(dev->clk); 708 708 709 709 dev->base = ioremap(mem->start, resource_size(mem)); 710 710 if (!dev->base) { ··· 751 751 err_unuse_clocks: 752 752 iounmap(dev->base); 753 753 err_mem_ioremap: 754 - clk_disable(dev->clk); 754 + clk_disable_unprepare(dev->clk); 755 755 clk_put(dev->clk); 756 756 dev->clk = NULL; 757 757 err_free_mem: ··· 775 775 i2c_del_adapter(&dev->adapter); 776 776 put_device(&pdev->dev); 777 777 778 - clk_disable(dev->clk); 778 + clk_disable_unprepare(dev->clk); 779 779 clk_put(dev->clk); 780 780 dev->clk = NULL; 781 781 ··· 797 797 798 798 /* put I2C into reset */ 799 799 davinci_i2c_reset_ctrl(i2c_dev, 0); 800 - clk_disable(i2c_dev->clk); 800 + clk_disable_unprepare(i2c_dev->clk); 801 801 802 802 return 0; 803 803 } ··· 807 807 struct platform_device *pdev = to_platform_device(dev); 808 808 struct davinci_i2c_dev *i2c_dev = platform_get_drvdata(pdev); 809 809 810 - clk_enable(i2c_dev->clk); 810 + clk_prepare_enable(i2c_dev->clk); 811 811 /* take I2C out of reset */ 812 812 davinci_i2c_reset_ctrl(i2c_dev, 1); 813 813