mtd: elm: Use correct check on return value of pm_runtime_get_sync
authorStefan Sørensen <stefan.sorensen@spectralink.com>
Mon, 3 Feb 2014 14:54:09 +0000 (15:54 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 11 Mar 2014 05:42:23 +0000 (22:42 -0700)
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@spectralink.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/devices/elm.c

index d1dd6a33a0500831f78012f9be91afa0161e4574..e2c073c5a7ccee77a06abe9b1ba2992e01445735 100644 (file)
@@ -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");