Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / devfreq: tegra30: Improve initial hardware resetting

It's safe to enable the ACTMON clock at any time during driver probing,
even if we don't know the state of hardware, because it's used only for
collecting and processing stats, and interrupt is kept disabled. This
allows us to slightly improve code which performs initial hardware
resetting by making use of a single reset_control_reset() instead of
assert/deassert pair. Secondly, a potential error of the reset-control
API is handled nicely now.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Dmitry Osipenko and committed by
Chanwoo Choi
d353d120 02bdbf7d

+5 -3
+5 -3
drivers/devfreq/tegra30-devfreq.c
··· 822 822 return err; 823 823 } 824 824 825 - reset_control_assert(tegra->reset); 826 - 827 825 err = clk_prepare_enable(tegra->clock); 828 826 if (err) { 829 827 dev_err(&pdev->dev, ··· 829 831 return err; 830 832 } 831 833 832 - reset_control_deassert(tegra->reset); 834 + err = reset_control_reset(tegra->reset); 835 + if (err) { 836 + dev_err(&pdev->dev, "Failed to reset hardware: %d\n", err); 837 + goto disable_clk; 838 + } 833 839 834 840 rate = clk_round_rate(tegra->emc_clock, ULONG_MAX); 835 841 if (rate < 0) {