Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754578Ab3JJJQF (ORCPT ); Thu, 10 Oct 2013 05:16:05 -0400 Received: from ns.mm-sol.com ([212.124.72.66]:41414 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019Ab3JJJQE (ORCPT ); Thu, 10 Oct 2013 05:16:04 -0400 From: "Ivan T. Ivanov" To: p.zabel@pengutronix.de Cc: linux-kernel@vger.kernel.org, "Ivan T. Ivanov" , Pavel Machek , Stephen Warren , Shawn Guo , Marek Vasut Subject: [PATCH] reset: Add non CONFIG_RESET_CONTROLLER routines Date: Thu, 10 Oct 2013 12:14:35 +0300 Message-Id: <1381396475-17848-1-git-send-email-iivanov@mm-sol.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2045 Lines: 82 From: "Ivan T. Ivanov" Make sure client drivers will still build on systems without reset control support. Signed-off-by: Ivan T. Ivanov Cc: Pavel Machek Cc: Stephen Warren Cc: Shawn Guo Cc: Marek Vasut --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/