mtd: elm: Use correct check on return value of pm_runtime_get_sync

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Apr 5 02:59:02 EDT 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0a21552a6e8ab9d3bacd490f5b94a178ce4d661d
Commit:     0a21552a6e8ab9d3bacd490f5b94a178ce4d661d
Parent:     60c3bc1fd6f1fa40b415ef5b83e2948a89a3d79c
Author:     Stefan Sørensen <stefan.sorensen at spectralink.com>
AuthorDate: Mon Feb 3 15:54:09 2014 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 10 22:42:23 2014 -0700

    mtd: elm: Use correct check on return value of pm_runtime_get_sync
    
    The ELM driver incorrectly reagard any non-zero return value from
    pm_runtime_get_sync as an error, but it may return 1 if the device
    was already active. Fix to only error when return value is negative.
    
    Signed-off-by: Stefan Sørensen <stefan.sorensen at spectralink.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/devices/elm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
index d1dd6a3..e2c073c 100644
--- a/drivers/mtd/devices/elm.c
+++ b/drivers/mtd/devices/elm.c
@@ -380,7 +380,7 @@ static int elm_probe(struct platform_device *pdev)
 	}
 
 	pm_runtime_enable(&pdev->dev);
-	if (pm_runtime_get_sync(&pdev->dev)) {
+	if (pm_runtime_get_sync(&pdev->dev) < 0) {
 		ret = -EINVAL;
 		pm_runtime_disable(&pdev->dev);
 		dev_err(&pdev->dev, "can't enable clock\n");



More information about the linux-mtd-cvs mailing list