linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: sathyanarayanan.kuppuswamy@linux.intel.com
Cc: linux-kernel@vger.kernel.org, sathyaosid@gmail.com
Subject: Re: [PATCH v1 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case
Date: Sat, 8 Jul 2017 22:55:03 +0200	[thread overview]
Message-ID: <fe9f5e79-a415-e880-feb3-3a4eaa4ae4cb@axentia.se> (raw)
In-Reply-To: <b401a6875042aa54f739403605ecaf30c9997aeb.1499463614.git.sathyanarayanan.kuppuswamy@linux.intel.com>

On 2017-07-07 23:41, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> Add dummy functions to avoid compile time issues when CONFIG_MULTIPLEXER
> is not enabled.

Hi!

Consumers should "select MULTIPLEXER", so this does not make sense.
Or do you have a driver that has an optional mux consumer?

> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> ---
>  include/linux/mux/consumer.h | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h
> index 5577e1b..744a5b8 100644
> --- a/include/linux/mux/consumer.h
> +++ b/include/linux/mux/consumer.h
> @@ -16,6 +16,7 @@
>  struct device;
>  struct mux_control;
>  
> +#ifdef CONFIG_MULTIPLEXER
>  unsigned int mux_control_states(struct mux_control *mux);
>  int __must_check mux_control_select(struct mux_control *mux,
>  				    unsigned int state);
> @@ -29,4 +30,41 @@ void mux_control_put(struct mux_control *mux);
>  struct mux_control *devm_mux_control_get(struct device *dev,
>  					 const char *mux_name);
>  
> +#else
> +unsigned int mux_control_states(struct mux_control *mux)

static inline

Cheers,
peda

> +{
> +	return -ENODEV;
> +}
> +
> +int __must_check mux_control_select(struct mux_control *mux,
> +				    unsigned int state)
> +{
> +	return -ENODEV;
> +}
> +
> +int __must_check mux_control_try_select(struct mux_control *mux,
> +					unsigned int state)
> +{
> +	return -ENODEV;
> +}
> +
> +int mux_control_deselect(struct mux_control *mux)
> +{
> +	return -ENODEV;
> +}
> +
> +struct mux_control *mux_control_get(struct device *dev, const char *mux_name)
> +{
> +	return ERR_PTR(-ENODEV);
> +}
> +
> +void mux_control_put(struct mux_control *mux) {}
> +
> +struct mux_control *devm_mux_control_get(struct device *dev,
> +					 const char *mux_name)
> +{
> +	return ERR_PTR(-ENODEV);
> +}
> +#endif
> +
>  #endif /* _LINUX_MUX_CONSUMER_H */
> 

  parent reply	other threads:[~2017-07-08 20:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 21:41 [PATCH v1 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case sathyanarayanan.kuppuswamy
2017-07-08 15:32 ` kbuild test robot
2017-07-08 20:55 ` Peter Rosin [this message]
2017-07-08 23:04   ` Kuppuswamy, Sathyanarayanan
2017-07-10  5:32     ` Peter Rosin

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=fe9f5e79-a415-e880-feb3-3a4eaa4ae4cb@axentia.se \
    --to=peda@axentia.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=sathyaosid@gmail.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;
as well as URLs for NNTP newsgroup(s).