Messages in this thread Patch in this message | | | From | "Ivan T. Ivanov" <> | Subject | [PATCH] reset: Add non CONFIG_RESET_CONTROLLER routines | Date | Thu, 10 Oct 2013 12:14:35 +0300 |
| |
From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Make sure client drivers will still build on systems without reset control support.
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Stephen Warren <swarren@nvidia.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Marek Vasut <marex@denx.de> --- include/linux/reset.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
diff --git a/include/linux/reset.h b/include/linux/reset.h index 6082247..0df3e30 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -4,6 +4,8 @@ struct device; struct reset_control; +#if defined(CONFIG_RESET_CONTROLLER) + int reset_control_reset(struct reset_control *rstc); int reset_control_assert(struct reset_control *rstc); int reset_control_deassert(struct reset_control *rstc); @@ -14,4 +16,46 @@ struct reset_control *devm_reset_control_get(struct device *dev, const char *id) int device_reset(struct device *dev); +#else /* !CONFIG_RESET_CONTROLLER */ + +/* + * Make sure client drivers will still build on systems without + * reset control support. + */ +static inline int reset_control_reset(struct reset_control *rstc) +{ + return 0; +} + +static inline int reset_control_assert(struct reset_control *rstc) +{ + return 0; +} + +static inline int reset_control_deassert(struct reset_control *rstc) +{ + return 0; +} + +static inline struct reset_control * +reset_control_get(struct device *dev, const char *id) +{ + return 0; +} + +static inline void reset_control_put(struct reset_control *rstc){} + +static inline struct reset_control * +devm_reset_control_get(struct device *dev, const char *id) +{ + return NULL; +} + +static inline int device_reset(struct device *dev) +{ + return 0; +} + +#endif + #endif -- 1.7.9.5
| |