aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/clk/sunxi-ng/ccu-sun8i-r.c
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2021-09-01 00:05:19 -0500
committerMaxime Ripard <maxime@cerno.tech>2021-09-13 09:03:20 +0200
commit9bec2b9c6134052994115d2d3374e96f2ccb9b9d (patch)
treed88efc6c48a46634dc1f113c960169ec0e2e5275 /drivers/clk/sunxi-ng/ccu-sun8i-r.c
parentclk: sunxi-ng: Add machine dependency to A83T CCU (diff)
downloadwireguard-linux-9bec2b9c6134052994115d2d3374e96f2ccb9b9d.tar.xz
wireguard-linux-9bec2b9c6134052994115d2d3374e96f2ccb9b9d.zip
clk: sunxi-ng: Unregister clocks/resets when unbinding
Currently, unbinding a CCU driver unmaps the device's MMIO region, while leaving its clocks/resets and their providers registered. This can cause a page fault later when some clock operation tries to perform MMIO. Fix this by separating the CCU initialization from the memory allocation, and then using a devres callback to unregister the clocks and resets. This also fixes a memory leak of the `struct ccu_reset`, and uses the correct owner (the specific platform driver) for the clocks and resets. Early OF clock providers are never unregistered, and limited error handling is possible, so they are mostly unchanged. The error reporting is made more consistent by moving the message inside of_sunxi_ccu_probe. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20210901050526.45673-2-samuel@sholland.org
Diffstat (limited to 'drivers/clk/sunxi-ng/ccu-sun8i-r.c')
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r.c b/drivers/clk/sunxi-ng/ccu-sun8i-r.c
index 4c8c491b87c2..9e754d1f754a 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-r.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-r.c
@@ -265,7 +265,7 @@ static void __init sunxi_r_ccu_init(struct device_node *node,
return;
}
- sunxi_ccu_probe(node, reg, desc);
+ of_sunxi_ccu_probe(node, reg, desc);
}
static void __init sun8i_a83t_r_ccu_setup(struct device_node *node)