2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 23:53:55 +08:00

I2C: OMAP: Fix the mismatch of pm_runtime enable and disable

Currently the i2c driver calls the pm_runtime_enable and never
the disable. This may cause a warning when pm_runtime_enable
checks for the count match.Fix the same by calling
pm_runtime_disable in the error and the remove path.

Cc: Rajendra Nayak <rnayak@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
This commit is contained in:
Shubhrajyoti D 2012-05-29 16:26:14 +05:30 committed by Wolfram Sang
parent 3dae3efb12
commit 2474051600

View File

@ -1090,6 +1090,7 @@ err_unuse_clocks:
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
pm_runtime_put(dev->dev); pm_runtime_put(dev->dev);
iounmap(dev->base); iounmap(dev->base);
pm_runtime_disable(&pdev->dev);
err_free_mem: err_free_mem:
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(dev); kfree(dev);
@ -1110,6 +1111,7 @@ omap_i2c_remove(struct platform_device *pdev)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
i2c_del_adapter(&dev->adapter); i2c_del_adapter(&dev->adapter);
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
pm_runtime_disable(&pdev->dev);
iounmap(dev->base); iounmap(dev->base);
kfree(dev); kfree(dev);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);