lkml.org 
[lkml]   [2008]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/7] au1xmmc: remove db1x00 board-specific functions from driver
    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




    \
     
     \ /
      Last update: 2008-05-13 11:31    [W:0.028 / U:0.380 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site