All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH 5/5] mmc: sdhci: Tidy together LED code
Date: Wed, 13 Apr 2016 15:36:25 +0300	[thread overview]
Message-ID: <570E3D49.9030204@intel.com> (raw)
In-Reply-To: <CAPDyKFqjY+qcie7mCJx-mmzO+rXgQPZZtBLY71gz=2Fh9op7OQ@mail.gmail.com>

On 13/04/16 15:15, Ulf Hansson wrote:
> On 13 April 2016 at 13:45, Adrian Hunter <adrian.hunter@intel.com> wrote:
>> On 13/04/16 14:42, Ulf Hansson wrote:
>>> On 12 April 2016 at 13:25, Adrian Hunter <adrian.hunter@intel.com> wrote:
>>>> ifdef's make the code more complicated and harder to read.
>>>> Move all the LED code together to reduce the ifdef's to
>>>> one place.
>>>>
>>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>>>> ---
>>>>  drivers/mmc/host/sdhci.c | 96 +++++++++++++++++++++++++++++++-----------------
>>>>  1 file changed, 63 insertions(+), 33 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>>> index be5b5c95138c..13f3dd8992d5 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;
>>>> @@ -246,7 +241,7 @@ static void sdhci_reinit(struct sdhci_host *host)
>>>>         sdhci_enable_card_detection(host);
>>>>  }
>>>>
>>>> -static void sdhci_activate_led(struct sdhci_host *host)
>>>> +static void __sdhci_led_activate(struct sdhci_host *host)
>>>
>>> The renaming here seems a bit unnecessary, but more importantly why
>>> can't you move these functions within the "if def sdhci leds" instead?
>>
>> They get used either way.  Either we use the LEDS subsystem (and mmc core
>> controls them) or we turn them on/off directly from sdhci_request() etc.
> 
> That seems wrong. Moreover it changes the current behaviour.

How does it change the current behaviour?  It was meant to be exactly the
same.  Perhaps looking closely at whether the original code was 'ifdef' or
'ifndef' will help.

> 
> I am not sure why you want to use the leds in case of when the LED
> subsystem isn't available?

I am attempting to preserve the existing behaviour, so that is just how it was.


  reply	other threads:[~2016-04-13 12:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 11:25 [PATCH 0/5] mmc: sdhci: Misc patches Adrian Hunter
2016-04-12 11:25 ` [PATCH 1/5] mmc: sdhci-pci: Set MMC_CAP_AGGRESSIVE_PM for Broxton controllers Adrian Hunter
2016-04-12 11:25 ` [PATCH 2/5] mmc: sdhci-acpi: " Adrian Hunter
2016-04-12 11:25 ` [PATCH 3/5] mmc: sdhci: Remove redundant condition Adrian Hunter
2016-04-12 11:25 ` [PATCH 4/5] mmc: sdhci: Fix error paths in sdhci_add_host() Adrian Hunter
2016-04-13 11:41   ` Ulf Hansson
2016-04-13 11:41     ` Adrian Hunter
2016-04-13 11:47       ` Ulf Hansson
2016-04-12 11:25 ` [PATCH 5/5] mmc: sdhci: Tidy together LED code Adrian Hunter
2016-04-13 11:42   ` Ulf Hansson
2016-04-13 11:45     ` Adrian Hunter
2016-04-13 12:15       ` Ulf Hansson
2016-04-13 12:36         ` Adrian Hunter [this message]
2016-04-13 13:45           ` Ulf Hansson

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=570E3D49.9030204@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.