mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
clk: raspberrypi: Handle cpufreq device registration failure
Check the return value of platform_device_register_data() when
registering the raspberrypi-cpufreq device and propagate the error
if registration fails.
This prevents the clock driver from reporting a successful probe
when the cpufreq device could not be registered.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Fixes: e2bb18347c ("clk: raspberrypi: register platform device for raspberrypi-cpufreq")
Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
e9e5451824
commit
e98e3d7120
|
|
@ -553,6 +553,8 @@ static int raspberrypi_clk_probe(struct platform_device *pdev)
|
|||
|
||||
rpi->cpufreq = platform_device_register_data(dev, "raspberrypi-cpufreq",
|
||||
-1, NULL, 0);
|
||||
if (IS_ERR(rpi->cpufreq))
|
||||
return PTR_ERR(rpi->cpufreq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user