mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-16 23:07:00 +00:00
clk: use private clk struct in CLK_CCF's enable/disable functions
In clk_enable()/clk_disable() functions, when CCF is activated, we must pass a private clk struct to enable()/disable() ops functions. Otherwise, the use of a container_of() construction within these ops should be banned. Because passing a non-private clk struct to container_of() results in an out of range error. At the moment, clk-mux, clk-fixed-factor, clk-gate and possibly other clocks use container_of() in their enable()/disable() functions. Therefore, for these functions to work correclty, private clk struct must be passed. Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20230905221649.3577929-1-bigunclemax@gmail.com
This commit is contained in:
parent
b6a56f5533
commit
0755db477f
1 changed files with 2 additions and 2 deletions
|
@ -656,7 +656,7 @@ int clk_enable(struct clk *clk)
|
|||
}
|
||||
|
||||
if (ops->enable) {
|
||||
ret = ops->enable(clk);
|
||||
ret = ops->enable(clkp ? clkp : clk);
|
||||
if (ret) {
|
||||
printf("Enable %s failed\n", clk->dev->name);
|
||||
return ret;
|
||||
|
@ -713,7 +713,7 @@ int clk_disable(struct clk *clk)
|
|||
}
|
||||
|
||||
if (ops->disable) {
|
||||
ret = ops->disable(clk);
|
||||
ret = ops->disable(clkp ? clkp : clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue