Skip to content

Commit

Permalink
cpufreq: sun50i: fix error returns in dt_has_supported_hw()
Browse files Browse the repository at this point in the history
The dt_has_supported_hw() function returns type bool.  That means these
negative error codes are cast to true but the function should return
false instead.

Fixes: fa5aec9 ("cpufreq: sun50i: Add support for opp_supported_hw")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
  • Loading branch information
Dan Carpenter authored and Viresh Kumar committed Apr 25, 2024
1 parent fa7bd98 commit 76a6fc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/cpufreq/sun50i-cpufreq-nvmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ static bool dt_has_supported_hw(void)

cpu_dev = get_cpu_device(0);
if (!cpu_dev)
return -ENODEV;
return false;

np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
if (!np)
return -ENOENT;
return false;

for_each_child_of_node(np, opp) {
if (of_find_property(opp, "opp-supported-hw", NULL)) {
Expand Down

0 comments on commit 76a6fc5

Please sign in to comment.