linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: sfr@canb.auug.org.au, lars@metafoo.de, olivier.moysan@st.com,
	mcoquelin.stm32@gmail.com, linux-iio@vger.kernel.org,
	pmeerw@pmeerw.net, rdunlap@infradead.org,
	arnaud.pouliquen@st.com, linux-kernel@vger.kernel.org,
	linux-next@vger.kernel.org, benjamin.gaignard@linaro.org,
	knaack.h@gmx.de, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org, alexandre.torgue@st.com
Subject: Re: [PATCH] iio: trigger: stm32-timer: fix build issue when disabled
Date: Mon, 22 Apr 2019 11:14:43 +0100	[thread overview]
Message-ID: <20190422111443.276572ff@archlinux> (raw)
In-Reply-To: <1555321642-482-1-git-send-email-fabrice.gasnier@st.com>

On Mon, 15 Apr 2019 11:47:22 +0200
Fabrice Gasnier <fabrice.gasnier@st.com> wrote:

> This fixes a build issue when CONFIG_IIO_STM32_TIMER_TRIGGER isn't set but
> used in stm32-dfsdm-adc driver (e.g. CONFIG_STM32_DFSDM_ADC is set):
> ERROR: "is_stm32_timer_trigger" [drivers/iio/adc/stm32-dfsdm-adc.ko]
> undefined!
> 
> There are two possible options to fix this issue:
> - select IIO_STM32_TIMER_TRIGGER along with CONFIG_STM32_DFSDM_ADC.
>   This is what's being done currently for CONFIG_STM32_ADC.
> - stub "is_stm32_timer_trigger" function
> 
> Choice is made to stub this function as suggested in [1]. This is also
> inspired by similar "is_stm32_lptim_trigger" function (see [2]) in
> include/linux/iio/timer/stm32-lptim-trigger.h
> 
> [1]
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1977377.html
> [2] https://lkml.org/lkml/2017/9/10/124
> 
> Fixes: 11646e81d775 ("iio: adc: stm32-dfsdm: add support for buffer modes")
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Fix-suggested-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Hmm. That feels a bit more complex than I was anticipating but fair enough,
it seems to cover the combinations.

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to have another poke at it.

Thanks,

Jonathan

> ---
>  include/linux/iio/timer/stm32-timer-trigger.h | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/iio/timer/stm32-timer-trigger.h b/include/linux/iio/timer/stm32-timer-trigger.h
> index d68add8..cbb7c7a 100644
> --- a/include/linux/iio/timer/stm32-timer-trigger.h
> +++ b/include/linux/iio/timer/stm32-timer-trigger.h
> @@ -73,6 +73,15 @@
>  
>  #define TIM17_OC1	"tim17_oc1"
>  
> +#if IS_REACHABLE(CONFIG_IIO_STM32_TIMER_TRIGGER)
>  bool is_stm32_timer_trigger(struct iio_trigger *trig);
> -
> +#else
> +static inline bool is_stm32_timer_trigger(struct iio_trigger *trig)
> +{
> +#if IS_ENABLED(CONFIG_IIO_STM32_TIMER_TRIGGER)
> +	pr_warn_once("stm32-timer-trigger not linked in\n");
> +#endif
> +	return false;
> +}
> +#endif
>  #endif


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2019-04-22 10:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15  9:47 [PATCH] iio: trigger: stm32-timer: fix build issue when disabled Fabrice Gasnier
2019-04-22 10:14 ` Jonathan Cameron [this message]

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=20190422111443.276572ff@archlinux \
    --to=jic23@kernel.org \
    --cc=alexandre.torgue@st.com \
    --cc=arnaud.pouliquen@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=fabrice.gasnier@st.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@st.com \
    --cc=pmeerw@pmeerw.net \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    /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).