TI clk driver cleanups
Subsystems (2)
cover TI clk driver cleanups
Some cleanups for the TI clk driver move.
Stephen Boyd (4):
clk: ti: Check kzalloc() for failures
clk: ti: Mark ti_clk_features static
clk: ti: clk-3xxx: Remove unused structures
clk: ti: Force pointer to be __iomem
drivers/clk/ti/clk-3xxx.c | 10 ---------- drivers/clk/ti/clk.c | 6 ++++-- 2 files changed, 4 insertions(+), 12 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 1/4 clk: ti: Check kzalloc() for failures
smatch reports a failure to check kzalloc() here:
drivers/clk/ti/clk.c:232omap2_clk_provider_init() error: potential null dereference 'io'. (kzalloc returns null)
Check for an allocation failure and return -ENOMEM.
--- drivers/clk/ti/clk.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/ti/clk.c +2 -0
@@ -228,6 +228,8 @@ int __init omap2_clk_provider_init(struct device_node *parent, int index, clocks_node_ptr[index] = clocks; io =kzalloc (sizeof (*io),GFP_KERNEL ); +if (!io) +return -ENOMEM ; io->regmap = syscon; io->mem = mem;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 2/4 clk: ti: Mark ti_clk_features static
In reply to Stephen BoydThis variable isn't exported outside of this file so mark it static. Silences the following sparse warning:
drivers/clk/ti/clk.c:36:24: warning: symbol 'ti_clk_features' was not declared. Should it be static?
--- drivers/clk/ti/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk.c +1 -1
@@ -33,7 +33,7 @@struct ti_clk_ll_ops *ti_clk_ll_ops;static struct device_node *clocks_node_ptr[CLK_MAX_MEMMAPS ]; -struct ti_clk_features ti_clk_features; +static struct ti_clk_features ti_clk_features;struct clk_iomap {struct regmap *regmap;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 3/4 clk: ti: clk-3xxx: Remove unused structures
In reply to Stephen BoydSparse complains about these structures missing static, but they also don't look to be used. Remove them.
drivers/clk/ti/clk-3xxx.c:74:30: warning: symbol 'clkhwops_omap3430es2_ssi_wait' was not declared. Should it be static? drivers/clk/ti/clk-3xxx.c:157:30: warning: symbol 'clkhwops_omap3430es2_hsotgusb_wait' was not declared. Should it be static?
--- drivers/clk/ti/clk-3xxx.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/clk/ti/clk-3xxx.c +0 -10
@@ -71,11 +71,6 @@ static void omap3430es2_clk_ssi_find_idlest(struct clk_hw_omap *clk, *idlest_val =OMAP34XX_CM_IDLEST_VAL ; } -const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait = { - .find_idlest = omap3430es2_clk_ssi_find_idlest, - .find_companion = omap2_clk_dflt_find_companion, -}; -const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait = { .allow_idle = omap2_clkt_iclk_allow_idle, .deny_idle = omap2_clkt_iclk_deny_idle,
@@ -154,11 +149,6 @@ const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait = { .find_companion = omap2_clk_dflt_find_companion, }; -const struct clk_hw_omap_ops clkhwops_omap3430es2_hsotgusb_wait = { - .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, - .find_companion = omap2_clk_dflt_find_companion, -}; -/** * am35xx_clk_find_idlest - return clock ACK info for AM35XX IPSS * @clk: struct clk * being enabled
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 3/4] clk: ti: clk-3xxx: Remove unused structures
Quoted 5 lines · Stephen Boyd
Sparse complains about these structures missing static, but they also don't look to be used. Remove them.
drivers/clk/ti/clk-3xxx.c:74:30: warning: symbol 'clkhwops_omap3430es2_ssi_wait' was not declared. Should it be static?drivers/clk/ti/clk-3xxx.c:157:30: warning: symbol 'clkhwops_omap3430es2_hsotgusb_wait' was not declared. Should it be static?
Interesting, I wonder if the references to these have accidentally been dropped at some point, namely (in 2012?) when we converted the clocks to use common clock struct.
Anyway, I guess we can fix the ssi/usb clocks later if we find some issues with them, its been at least 3 years since these have been used.
-Tero
Quoted 36 lines
Cc Tero Kristo <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/clk/ti/clk-3xxx.c | 10 ---------- 1 file changed, 10 deletions(-)drivers/clk/ti/clk-3xxx.c +0
-10@@ -71,11 +71,6 @@ static void omap3430es2_clk_ssi_find_idlest(struct clk_hw_omap *clk, *idlest_val =OMAP34XX_CM_IDLEST_VAL ; } -const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait = { - .find_idlest = omap3430es2_clk_ssi_find_idlest, - .find_companion = omap2_clk_dflt_find_companion, -}; -const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait = { .allow_idle = omap2_clkt_iclk_allow_idle, .deny_idle = omap2_clkt_iclk_deny_idle,@@ -154,11 +149,6 @@ const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait = { .find_companion = omap2_clk_dflt_find_companion, }; -const struct clk_hw_omap_ops clkhwops_omap3430es2_hsotgusb_wait = { - .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, - .find_companion = omap2_clk_dflt_find_companion, -}; -/** * am35xx_clk_find_idlest - return clock ACK info for AM35XX IPSS * @clk: struct clk * being enabled
PATCH 4/4 clk: ti: Force pointer to be __iomem
In reply to Stephen BoydAdd __force here so that sparse doesn't complain about us playing tricks with __iomem.
---
This whole scheme is really ugly, hopefully it can be cleaned up soon.
drivers/clk/ti/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk.c +1 -1
@@ -194,7 +194,7 @@ void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index) reg->offset = val; -return (void __iomem *)tmp; +return (__force void __iomem *)tmp; }/**
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 8 lines · Stephen Boyd
Some cleanups for the TI clk driver move.
Stephen Boyd (4):
clk: ti: Checkkzalloc()for failures
clk: ti: Markti_clk_featuresstatic
clk: ti: clk-3xxx: Remove unused structures
clk: ti: Force pointer to be__iomem
Quoted 4 lines
drivers/clk/ti/clk-3xxx.c | 10 ---------- drivers/clk/ti/clk.c | 6 ++++-- 2 files changed, 4 insertions(+), 12 deletions(-)
For the whole set: