public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: Fix compilation error when CONFIG_PWM is not defined
@ 2012-09-11  6:04 Tushar Behera
  2012-09-11  6:19 ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Tushar Behera @ 2012-09-11  6:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: thierry.reding, sachin.kamat, patches

As per Documentation/pwm.txt, PWM_LOOKUP and pwm_add_table are used in
board support files to add PWM chip entries. Currently these
definitions are protected within CONFIG_PWM macro in
include/linux/pwm.h.

Otherwise, we have to add ifdef's in machine file to fix following
compilation error.

error: array type has incomplete element type
error: implicit declaration of function ‘PWM_LOOKUP’ [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘pwm_add_table’ [-Werror=implicit-function-declaration]
error: bit-field ‘<anonymous>’ width not an integer constant

Reported-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 include/linux/pwm.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 21d076c..87e7f45 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -124,6 +124,7 @@ struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
 
 struct pwm_device *pwm_get(struct device *dev, const char *consumer);
 void pwm_put(struct pwm_device *pwm);
+#endif
 
 struct pwm_lookup {
 	struct list_head list;
@@ -141,8 +142,10 @@ struct pwm_lookup {
 		.con_id = _con_id,			\
 	}
 
+#ifdef CONFIG_PWM
 void pwm_add_table(struct pwm_lookup *table, size_t num);
-
+#else
+static void pwm_add_table(struct pwm_lookup *table, size_t num) {}
 #endif
 
 #endif /* __LINUX_PWM_H */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-11  8:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-11  6:04 [PATCH] pwm: Fix compilation error when CONFIG_PWM is not defined Tushar Behera
2012-09-11  6:19 ` Thierry Reding
2012-09-11  8:35   ` Tushar Behera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox