All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Manuel Lauss <mano@roarinelk.homelinux.net>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] au1xmmc: remove db1x00 board-specific functions from driver
Date: Tue, 13 May 2008 13:27:24 +0400	[thread overview]
Message-ID: <48295EFC.9090508@ru.mvista.com> (raw)
In-Reply-To: <20080508080301.GD24383@roarinelk.homelinux.net>

Hello.

Manuel Lauss wrote:
> Remove the DB1200 board-specific functions (card present, read-only
> methods) and instead add platform data which is passed to the driver.
> This allows for platforms to implement other carddetect schemes
> (e.g. dedicated irq) without having to pollute the driver code.
> The poll timer (used for pb1200) is kept for compatibility.
>
> With the board-specific stuff gone, the driver no longer needs to know
> how many physical controllers the silicon actually has; every device
> can be registered as needed, update the code to reflect that.
>
> Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
[...]
> diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
> index cc5f7bc..8660f86 100644
> --- a/drivers/mmc/host/au1xmmc.c
> +++ b/drivers/mmc/host/au1xmmc.c
[...]
> +static int __devinit au1xmmc_probe(struct platform_device *pdev)
> +{
> +	struct mmc_host *mmc;
> +	struct au1xmmc_host *host;
> +	struct resource *r;
> +	int ret;
> +
> +	mmc = mmc_alloc_host(sizeof(struct au1xmmc_host), &pdev->dev);
> +	if (!mmc) {
> +		dev_err(&pdev->dev, "no memory for mmc host\n");
> +		ret = -ENOMEM;
> +		goto out0;
> +	}
>  
> -		if (!mmc) {
> -			printk(DRIVER_NAME "ERROR: no mem for host %d\n", i);
> -			au1xmmc_hosts[i] = 0;
> -			continue;
> -		}
> +	host = mmc_priv(mmc);
> +	host->mmc = mmc;
> +	host->platdata = pdev->dev.platform_data;
> +	host->pdev = pdev;
>  
> -		mmc->ops = &au1xmmc_ops;
> +	ret = -ENODEV;
> +	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!r) {
> +		dev_err(&pdev->dev, "no mmio defined\n");
> +		goto out1;
> +	}
>   

   I forgot to mention that the driver should be calling 
request_mem_region() here...

WBR, Sergei

  parent reply	other threads:[~2008-05-13  9:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  8:00 [PATCH 0/7] au1xmmc updates, #2 Manuel Lauss
2008-05-08  8:01 ` [PATCH 1/7] Alchemy: export get_au1x00_speed for modules Manuel Lauss
2008-05-08  8:01   ` Manuel Lauss
2008-05-08  8:02 ` [PATCH 2/7] Alchemy: dbdma: add API to delete custom DDMA device ids Manuel Lauss
2008-05-08  8:02   ` Manuel Lauss
2008-05-08  8:03 ` [PATCH 3/7] au1xmmc: remove db1x00 board-specific functions from driver Manuel Lauss
2008-05-08  8:03   ` Manuel Lauss
2008-05-12 11:36   ` Sergei Shtylyov
2008-05-14  8:37     ` Manuel Lauss
2008-05-13  9:27   ` Sergei Shtylyov [this message]
2008-05-08  8:03 ` [PATCH 4/7] Alchemy: register mmc platform device for db1200/pb1200 boards Manuel Lauss
2008-05-08  8:03   ` Manuel Lauss
2008-05-08  8:04 ` [PATCH 5/7] au1xmmc: 4 bit transfer mode Manuel Lauss
2008-05-08  8:04   ` Manuel Lauss
2008-05-08  8:04 ` [PATCH 6/7] au1xmmc: wire up SDIO interrupt Manuel Lauss
2008-05-08  8:04   ` Manuel Lauss
2008-05-08  8:05 ` [PATCH 7/7] au1xmmc: codingstyle tidying Manuel Lauss
2008-05-08  8:05   ` Manuel Lauss

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=48295EFC.9090508@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mano@roarinelk.homelinux.net \
    /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.