The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-mmc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] mmc: sdhci: use IS_REACHABLE(CONFIG_LEDS_CLASS) to enable LED code
Date: Wed, 13 Apr 2016 11:59:43 +0300	[thread overview]
Message-ID: <570E0A7F.8070200@intel.com> (raw)
In-Reply-To: <1460537730-23430-1-git-send-email-yamada.masahiro@socionext.com>

On 13/04/16 11:55, Masahiro Yamada wrote:
> defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
>     defined(CONFIG_MMC_SDHCI_MODULE))
> 
> is equivalent to:
> 
> defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
>     defined(MODULE))
> 
> and it can also be written shortly as:
> 
> IS_REACHABLE(CONFIG_LEDS_CLASS)
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

I recently sent a change to the LEDS code:

	http://marc.info/?l=linux-mmc&m=146046055330711

So, if that is accepted, this will need to be changed - there will be only
one place CONFIG_LEDS_CLASS is used then.

> ---
> 
>  drivers/mmc/host/sdhci.c | 17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 6bd3d17..7a4fbe8 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -38,11 +38,6 @@
>  #define DBG(f, x...) \
>  	pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x)
>  
> -#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
> -	defined(CONFIG_MMC_SDHCI_MODULE))
> -#define SDHCI_USE_LEDS_CLASS
> -#endif
> -
>  #define MAX_TUNING_LOOP 40
>  
>  static unsigned int debug_quirks = 0;
> @@ -270,7 +265,7 @@ static void sdhci_deactivate_led(struct sdhci_host *host)
>  	sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
>  }
>  
> -#ifdef SDHCI_USE_LEDS_CLASS
> +#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>  static void sdhci_led_control(struct led_classdev *led,
>  	enum led_brightness brightness)
>  {
> @@ -1328,7 +1323,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  
>  	WARN_ON(host->mrq != NULL);
>  
> -#ifndef SDHCI_USE_LEDS_CLASS
> +#if !IS_REACHABLE(CONFIG_LEDS_CLASS)
>  	sdhci_activate_led(host);
>  #endif
>  
> @@ -2214,7 +2209,7 @@ static void sdhci_tasklet_finish(unsigned long param)
>  	host->cmd = NULL;
>  	host->data = NULL;
>  
> -#ifndef SDHCI_USE_LEDS_CLASS
> +#if !IS_REACHABLE(CONFIG_LEDS_CLASS)
>  	sdhci_deactivate_led(host);
>  #endif
>  
> @@ -3360,7 +3355,7 @@ int sdhci_add_host(struct sdhci_host *host)
>  	sdhci_dumpregs(host);
>  #endif
>  
> -#ifdef SDHCI_USE_LEDS_CLASS
> +#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>  	snprintf(host->led_name, sizeof(host->led_name),
>  		"%s::", mmc_hostname(mmc));
>  	host->led.name = host->led_name;
> @@ -3390,7 +3385,7 @@ int sdhci_add_host(struct sdhci_host *host)
>  
>  	return 0;
>  
> -#ifdef SDHCI_USE_LEDS_CLASS
> +#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>  reset:
>  	sdhci_do_reset(host, SDHCI_RESET_ALL);
>  	sdhci_writel(host, 0, SDHCI_INT_ENABLE);
> @@ -3430,7 +3425,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
>  
>  	mmc_remove_host(mmc);
>  
> -#ifdef SDHCI_USE_LEDS_CLASS
> +#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>  	led_classdev_unregister(&host->led);
>  #endif
>  
> 

  reply	other threads:[~2016-04-13  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13  8:55 [PATCH] mmc: sdhci: use IS_REACHABLE(CONFIG_LEDS_CLASS) to enable LED code Masahiro Yamada
2016-04-13  8:59 ` Adrian Hunter [this message]
2016-04-13  9:09   ` Masahiro Yamada
2016-04-14  4:26   ` Masahiro Yamada

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=570E0A7F.8070200@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=yamada.masahiro@socionext.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