diff mbox

[U-Boot] rockchip: clk: rk3368: use correct (i.e. 'rk3368_clk_priv') structure for auto-alloc

Message ID 1499799585-27270-1-git-send-email-philipp.tomsich@theobroma-systems.com
State Accepted
Delegated to: Philipp Tomsich
Headers show

Commit Message

Philipp Tomsich July 11, 2017, 6:59 p.m. UTC
The clk driver for the RK3368 picked the wrong data structure's size
for its auto-alloc size: the size was calculated on the structure
representing the CRU hardware block instead of the priv structure.
As the CRU's register file is much larger than the driver's priv,
this did not cause any pain (except wasting memory).

Fix this by using the correct data structure's size.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

 drivers/clk/rockchip/clk_rk3368.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass July 12, 2017, 12:32 a.m. UTC | #1
On 11 July 2017 at 12:59, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> The clk driver for the RK3368 picked the wrong data structure's size
> for its auto-alloc size: the size was calculated on the structure
> representing the CRU hardware block instead of the priv structure.
> As the CRU's register file is much larger than the driver's priv,
> this did not cause any pain (except wasting memory).
>
> Fix this by using the correct data structure's size.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
>  drivers/clk/rockchip/clk_rk3368.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Philipp Tomsich July 12, 2017, 10:36 a.m. UTC | #2
> The clk driver for the RK3368 picked the wrong data structure's size
> for its auto-alloc size: the size was calculated on the structure
> representing the CRU hardware block instead of the priv structure.
> As the CRU's register file is much larger than the driver's priv,
> this did not cause any pain (except wasting memory).
> 
> Fix this by using the correct data structure's size.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  drivers/clk/rockchip/clk_rk3368.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!
diff mbox

Patch

diff --git a/drivers/clk/rockchip/clk_rk3368.c b/drivers/clk/rockchip/clk_rk3368.c
index b16c075..18ae287 100644
--- a/drivers/clk/rockchip/clk_rk3368.c
+++ b/drivers/clk/rockchip/clk_rk3368.c
@@ -434,7 +434,7 @@  U_BOOT_DRIVER(rockchip_rk3368_cru) = {
 	.name		= "rockchip_rk3368_cru",
 	.id		= UCLASS_CLK,
 	.of_match	= rk3368_clk_ids,
-	.priv_auto_alloc_size = sizeof(struct rk3368_cru),
+	.priv_auto_alloc_size = sizeof(struct rk3368_clk_priv),
 #if CONFIG_IS_ENABLED(OF_PLATDATA)
 	.platdata_auto_alloc_size = sizeof(struct rk3368_clk_plat),
 #endif