linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Make MMCI driver compile without gpiolib
Date: Sun, 27 Sep 2009 16:31:08 +0100	[thread overview]
Message-ID: <20090927153108.GA20093@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1251276988-27882-1-git-send-email-linus.walleij@stericsson.com>

On Wed, Aug 26, 2009 at 10:56:28AM +0200, Linus Walleij wrote:
> The recent addition of optional gpiolib support to check if a
> card was inserted or write protected was really not optional.
> It needs this ifdef to become optional so that U300 compiles,
> for example.

Looking back at this, I don't think this ifdef is required.

Why?

We're using linux/gpio.h, which provides dummy definitions for the
GPIO functions of GENERIC_GPIO is not set.  If GENERIC_GPIO is set,
then GPIOs are available, and can be used.

GPIOLIB is entirely a different matter, and doesn't really indicate
whether GPIO support is available or not.

The real problem is that U300 doesn't implement gpio_is_valid() -
which is part of the GPIO API and not specific to GPIOLIB.

Please implement this function, and let's revert this (wrong) patch.

> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 5eb86a8..a923ee2 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -619,6 +619,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
>  	writel(0, host->base + MMCIMASK1);
>  	writel(0xfff, host->base + MMCICLEAR);
>  
> +#ifdef CONFIG_GPIOLIB
>  	if (gpio_is_valid(plat->gpio_cd)) {
>  		ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)");
>  		if (ret == 0)
> @@ -637,6 +638,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
>  		else if (ret != -ENOSYS)
>  			goto err_gpio_wp;
>  	}
> +#endif
>  
>  	ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host);
>  	if (ret)

  reply	other threads:[~2009-09-27 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26  8:56 [PATCH] Make MMCI driver compile without gpiolib Linus Walleij
2009-09-27 15:31 ` Russell King - ARM Linux [this message]
2009-09-27 19:11   ` Linus Walleij
2009-09-28 19:00   ` Linus Walleij
2009-09-28 19:18     ` Baruch Siach
2009-09-28 20:03     ` Russell King - ARM Linux

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=20090927153108.GA20093@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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 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).