Skip to content

Commit

Permalink
PM / devfreq: exynos-bus: Disable devfreq-event device when fails
Browse files Browse the repository at this point in the history
The exynos_bus_profile_init process may fail, but the devfreq event device
remains enabled. Call devfreq_event_disable_edev on the error return path.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
  • Loading branch information
TinyWindzz authored and chanwoochoi committed Dec 30, 2019
1 parent 39a6e47 commit 6c315d8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/devfreq/exynos-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,16 @@ static int exynos_bus_profile_init(struct exynos_bus *bus,
ret = exynos_bus_set_event(bus);
if (ret < 0) {
dev_err(dev, "failed to set event to devfreq-event devices\n");
return ret;
goto err_edev;
}

return 0;

err_edev:
if (exynos_bus_disable_edev(bus))
dev_warn(dev, "failed to disable the devfreq-event devices\n");

return ret;
}

static int exynos_bus_profile_init_passive(struct exynos_bus *bus,
Expand Down

0 comments on commit 6c315d8

Please sign in to comment.