Skip to content

Commit 511aba0

Browse files
mripardbebarino
authored andcommitted
firmware: rpi: Only create clocks device if we don't have a node for it
The firmware clocks driver was previously probed through a platform_device created by the firmware driver. Since we will now have a node for that clocks driver, we need to create the device only in the case where there's no node for it already. Reviewed-by: Nicolas Saenz Julienne <[email protected]> Tested-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/72114c4287ebda2dbd952ea238d4489d359897e5.1592210452.git-series.maxime@cerno.tech Signed-off-by: Stephen Boyd <[email protected]>
1 parent 74a0caa commit 511aba0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/firmware/raspberrypi.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,20 @@ rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw)
208208

209209
static void rpi_register_clk_driver(struct device *dev)
210210
{
211+
struct device_node *firmware;
212+
213+
/*
214+
* Earlier DTs don't have a node for the firmware clocks but
215+
* rely on us creating a platform device by hand. If we do
216+
* have a node for the firmware clocks, just bail out here.
217+
*/
218+
firmware = of_get_compatible_child(dev->of_node,
219+
"raspberrypi,firmware-clocks");
220+
if (firmware) {
221+
of_node_put(firmware);
222+
return;
223+
}
224+
211225
rpi_clk = platform_device_register_data(dev, "raspberrypi-clk",
212226
-1, NULL, 0);
213227
}

0 commit comments

Comments
 (0)