devfreq: return error code when governor start fails

If there is a failure in starting hw monitor required for
memlat governor, return the error code to devfreq framework
so that the framework  will make sure the governor is
switched back to previous governor.

Change-Id: I76705725fc8b94d5341b1b8af7c1bd2b79e7642a
Signed-off-by: Santosh Mardi <[email protected]>
[[email protected]: minor change to check ret < 0]
Signed-off-by: Amir Vajid <[email protected]>
This commit is contained in:
Santosh Mardi 2019-01-03 10:52:14 +05:30 • committed by Amir Vajid
commit 5310a38087

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2015-2018, 2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "mem_lat: " fmt
@ -182,7 +182,8 @@ static int gov_start(struct devfreq *df)
node->orig_data = df->data;
df->data = node;
if (start_monitor(df))
ret = start_monitor(df);
if (ret < 0)
goto err_start;
ret = sysfs_create_group(&df->dev.kobj, node->attr_grp);