1 From d390147e2279a58b4476fdd1d6a0891af82a531e Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 9 Aug 2013 18:47:27 +0200
4 Subject: [PATCH 34/34] reset: Fix compile when reset RESET_CONTROLLER is not
7 Drivers need to protect their reset api calls with #ifdef to avoid compile
10 This patch adds dummy wrappers in the same way that linux/of.h does it.
12 Cc: linux-kernel@vger.kernel.org
13 Cc: Philipp Zabel <p.zabel@pengutronix.de>
14 Cc: Gabor Juhos <juhosg@openwrt.org>
16 include/linux/reset-controller.h | 16 ++++++++++++++
17 include/linux/reset.h | 43 ++++++++++++++++++++++++++++++++++++++
18 2 files changed, 59 insertions(+)
20 --- a/include/linux/reset-controller.h
21 +++ b/include/linux/reset-controller.h
22 @@ -45,7 +45,23 @@ struct reset_controller_dev {
23 unsigned int nr_resets;
26 +#if defined(CONFIG_RESET_CONTROLLER)
28 int reset_controller_register(struct reset_controller_dev *rcdev);
29 void reset_controller_unregister(struct reset_controller_dev *rcdev);
33 +static inline int reset_controller_register(struct reset_controller_dev *rcdev)
38 +void reset_controller_unregister(struct reset_controller_dev *rcdev)
46 --- a/include/linux/reset.h
47 +++ b/include/linux/reset.h
49 #ifndef _LINUX_RESET_H_
50 #define _LINUX_RESET_H_
52 +#include <linux/err.h>
57 +#if defined(CONFIG_RESET_CONTROLLER)
59 int reset_control_reset(struct reset_control *rstc);
60 int reset_control_assert(struct reset_control *rstc);
61 int reset_control_deassert(struct reset_control *rstc);
62 @@ -14,4 +18,43 @@ struct reset_control *devm_reset_control
64 int device_reset(struct device *dev);
66 +#else /* CONFIG_RESET_CONTROLLER */
68 +static inline int reset_control_reset(struct reset_control *rstc)
73 +static inline int reset_control_assert(struct reset_control *rstc)
78 +static inline int reset_control_deassert(struct reset_control *rstc)
83 +static inline struct reset_control *reset_control_get(struct device *dev, const char *id)
85 + return ERR_PTR(-ENOSYS);
88 +static inline void reset_control_put(struct reset_control *rstc)
93 +static inline struct reset_control *devm_reset_control_get(struct device *dev, const char *id)
95 + return ERR_PTR(-ENOSYS);
98 +static inline int device_reset(struct device *dev)