]> Git Repo - linux.git/commitdiff
PM / devfreq: Propagate error from devfreq_add_device()
authorBjorn Andersson <[email protected]>
Mon, 6 Nov 2017 05:27:41 +0000 (21:27 -0800)
committerMyungJoo Ham <[email protected]>
Tue, 2 Jan 2018 00:36:54 +0000 (09:36 +0900)
Propagate the error of devfreq_add_device() in devm_devfreq_add_device()
rather than statically returning ENOMEM. This makes it slightly faster
to pinpoint the cause of a returned error.

Fixes: 8cd84092d35e ("PM / devfreq: Add resource-managed function for devfreq device")
Cc: [email protected]
Acked-by: Chanwoo Choi <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
drivers/devfreq/devfreq.c

index 78fb496ecb4e7775622176dc10550a7636c6afc0..99c4021fc33b0ba4e79fb8453584dd6c56e0e962 100644 (file)
@@ -737,7 +737,7 @@ struct devfreq *devm_devfreq_add_device(struct device *dev,
        devfreq = devfreq_add_device(dev, profile, governor_name, data);
        if (IS_ERR(devfreq)) {
                devres_free(ptr);
-               return ERR_PTR(-ENOMEM);
+               return devfreq;
        }
 
        *ptr = devfreq;
This page took 0.061327 seconds and 4 git commands to generate.