PM / devfreq: Fix faulty error message
Quoted 19 lines
The misleading log "releasing devfreq which doesn't exist" prints out for well behaved clients. This is due to the fact that
_remove_devfreqcalls itself recursively by proxy (viaput_device()). The second time_devfreq_removeis called the respective device has already been deleted, causing the misleading warning.So just skip printing the message if
_devfreq_removewas called viaput_device().Signed-off-by Deva Ramasubramanian <[email protected]>--- drivers/devfreq/devfreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/devfreq/devfreq.c +0
-0
drivers/devfreq/devfreq.c static void _remove_devfreq(struct devfreq *devfreq) · line 403
Quoted 6 lines
drivers/devfreq/devfreq.c +2
-1@@ -399,7 +399,8 @@ static void _remove_devfreq(struct devfreq *devfreq)mutex_lock (&devfreq_list_lock);if (IS_ERR (find_device_devfreq (devfreq->dev.parent))) {mutex_unlock (&devfreq_list_lock); -dev_warn (&devfreq->dev,"releasing devfreq which doesn't exist\n" ); +if (!skip) +dev_warn (&devfreq->dev,"releasing devfreq which doesn't exist\n" );
There is no variable 'skip' in the function. (you get build error.) And with patch 585fc83ece43be63, we do not call the function recursively, either.
---drivers/devfreq/devfreq.c: In function ‘_remove_devfreq’:drivers/devfreq/devfreq.c:402:8: error: ‘skip’ undeclared (first use in this function) drivers/devfreq/devfreq.c:402:8: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [drivers/devfreq/devfreq.o] Error 1
make[1]: *** [drivers/devfreq] Error 2
make[1]: *** Waiting for unfinished jobs....
---
I'll update the function description.
Cheers,
MyungJoo.
Quoted 6 lines
drivers/devfreq/devfreq.c +0
-0return ; }list_del (&devfreq->node);Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project