diff options
| author | Mike Turquette <mturquette@linaro.org> | 2012-03-29 17:30:40 -0400 |
|---|---|---|
| committer | Mike Turquette <mturquette@linaro.org> | 2012-04-24 19:37:39 -0400 |
| commit | d1302a36a7f1c33d1a8babc6a510e1401a5e5aed (patch) | |
| tree | bcb0d5f659a762764b75720fdada09ac9c548886 /include/linux | |
| parent | d305fb78f31209596c9135d396a0d3af7ac86947 (diff) | |
clk: core: copy parent_names & return error codes
This patch cleans up clk_register and solves a few bugs by teaching
clk_register and __clk_init to return error codes (instead of just NULL)
to better align with the existing clk.h api.
Along with that change this patch also introduces a new behavior whereby
clk_register copies the parent_names array, thus allowing platforms to
declare their parent_names arrays as __initdata.
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/clk-private.h | 4 | ||||
| -rw-r--r-- | include/linux/clk-provider.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h index e9c8b9841b16..e7032fdd45eb 100644 --- a/include/linux/clk-private.h +++ b/include/linux/clk-private.h | |||
| @@ -181,8 +181,10 @@ struct clk { | |||
| 181 | * | 181 | * |
| 182 | * It is not necessary to call clk_register if __clk_init is used directly with | 182 | * It is not necessary to call clk_register if __clk_init is used directly with |
| 183 | * statically initialized clock data. | 183 | * statically initialized clock data. |
| 184 | * | ||
| 185 | * Returns 0 on success, otherwise an error code. | ||
| 184 | */ | 186 | */ |
| 185 | void __clk_init(struct device *dev, struct clk *clk); | 187 | int __clk_init(struct device *dev, struct clk *clk); |
| 186 | 188 | ||
| 187 | #endif /* CONFIG_COMMON_CLK */ | 189 | #endif /* CONFIG_COMMON_CLK */ |
| 188 | #endif /* CLK_PRIVATE_H */ | 190 | #endif /* CLK_PRIVATE_H */ |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 8981435f9064..97f9fabf3be2 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -274,7 +274,8 @@ struct clk *clk_register_mux(struct device *dev, const char *name, | |||
| 274 | * clk_register is the primary interface for populating the clock tree with new | 274 | * clk_register is the primary interface for populating the clock tree with new |
| 275 | * clock nodes. It returns a pointer to the newly allocated struct clk which | 275 | * clock nodes. It returns a pointer to the newly allocated struct clk which |
| 276 | * cannot be dereferenced by driver code but may be used in conjuction with the | 276 | * cannot be dereferenced by driver code but may be used in conjuction with the |
| 277 | * rest of the clock API. | 277 | * rest of the clock API. In the event of an error clk_register will return an |
| 278 | * error code; drivers must test for an error code after calling clk_register. | ||
| 278 | */ | 279 | */ |
| 279 | struct clk *clk_register(struct device *dev, const char *name, | 280 | struct clk *clk_register(struct device *dev, const char *name, |
| 280 | const struct clk_ops *ops, struct clk_hw *hw, | 281 | const struct clk_ops *ops, struct clk_hw *hw, |
