From: Philipp Zabel <p.zabel@pengutronix.de>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,
Stephen Warren <swarren@nvidia.com>,
Shawn Guo <shawn.guo@linaro.org>, Marek Vasut <marex@denx.de>
Subject: Re: [PATCH] reset: Add non CONFIG_RESET_CONTROLLER routines
Date: Thu, 10 Oct 2013 11:51:16 +0200 [thread overview]
Message-ID: <1381398676.5293.7.camel@pizza.hi.pengutronix.de> (raw)
In-Reply-To: <1381396475-17848-1-git-send-email-iivanov@mm-sol.com>
Hi Ivan,
Am Donnerstag, den 10.10.2013, 12:14 +0300 schrieb Ivan T. Ivanov:
> From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
>
> Make sure client drivers will still build on systems
> without reset control support.
the stubs should at least return errors, but then this turns a compile
time error into a runtime error for devices that don't work without
being properly reset.
Please also refer to this thread:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/174758.html
regards
Philipp
> 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
next prev parent reply other threads:[~2013-10-10 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-10 9:14 Ivan T. Ivanov
2013-10-10 9:51 ` Philipp Zabel [this message]
2013-10-10 11:45 ` Ivan T. Ivanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381398676.5293.7.camel@pizza.hi.pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=iivanov@mm-sol.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=pavel@ucw.cz \
--cc=shawn.guo@linaro.org \
--cc=swarren@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®