From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shubhrajyoti D Subject: [PATCHv8 06/18] I2C: OMAP: Fix the mismatch of pm_runtime enable and disable Date: Thu, 12 Apr 2012 18:36:23 +0530 Message-ID: <1334235995-6727-7-git-send-email-shubhrajyoti@ti.com> References: <1334235995-6727-1-git-send-email-shubhrajyoti@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1334235995-6727-1-git-send-email-shubhrajyoti@ti.com> Sender: linux-omap-owner@vger.kernel.org To: linux-omap@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ben-linux@fluff.org, tony@atomide.com, w.sang@pengutronix.de, Shubhrajyoti D , Kevin Hilman , Rajendra Nayak List-Id: linux-i2c@vger.kernel.org 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.Attempting to fix the same by calling pm_runtime_disable in the error and the remove path. Cc: Kevin Hilman Cc: Rajendra Nayak Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 2769f67..3670088 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1124,6 +1124,7 @@ err_unuse_clocks: omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); pm_runtime_put(dev->dev); iounmap(dev->base); + pm_runtime_disable(&pdev->dev); err_free_mem: platform_set_drvdata(pdev, NULL); kfree(dev); @@ -1144,6 +1145,7 @@ omap_i2c_remove(struct platform_device *pdev) free_irq(dev->irq, dev); i2c_del_adapter(&dev->adapter); omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); + pm_runtime_disable(&pdev->dev); iounmap(dev->base); kfree(dev); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- 1.7.4.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: shubhrajyoti@ti.com (Shubhrajyoti D) Date: Thu, 12 Apr 2012 18:36:23 +0530 Subject: [PATCHv8 06/18] I2C: OMAP: Fix the mismatch of pm_runtime enable and disable In-Reply-To: <1334235995-6727-1-git-send-email-shubhrajyoti@ti.com> References: <1334235995-6727-1-git-send-email-shubhrajyoti@ti.com> Message-ID: <1334235995-6727-7-git-send-email-shubhrajyoti@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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.Attempting to fix the same by calling pm_runtime_disable in the error and the remove path. Cc: Kevin Hilman Cc: Rajendra Nayak Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 2769f67..3670088 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1124,6 +1124,7 @@ err_unuse_clocks: omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); pm_runtime_put(dev->dev); iounmap(dev->base); + pm_runtime_disable(&pdev->dev); err_free_mem: platform_set_drvdata(pdev, NULL); kfree(dev); @@ -1144,6 +1145,7 @@ omap_i2c_remove(struct platform_device *pdev) free_irq(dev->irq, dev); i2c_del_adapter(&dev->adapter); omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); + pm_runtime_disable(&pdev->dev); iounmap(dev->base); kfree(dev); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- 1.7.4.1