mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-16 07:24:39 +08:00
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@spectralink.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
60c3bc1fd6
commit
0a21552a6e
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user