lkml.org 
[lkml]   [2012]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v7 1/2] mfd: Add anatop mfd driver
    On Sun, Mar 04, 2012 at 01:39:12AM +0800, Ying-Chun Liu (PaulLiu) wrote:
    ...
    > +static int of_anatop_probe(struct platform_device *pdev)

    __devinit

    > +{
    > + struct device *dev = &pdev->dev;
    > + struct device_node *np = dev->of_node;
    > + void *ioreg;
    > + struct anatop *drvdata;
    > +
    > + ioreg = of_iomap(np, 0);
    > + if (!ioreg)
    > + return -EINVAL;
    > + drvdata = devm_kzalloc(dev, sizeof(struct anatop), GFP_KERNEL);
    > + if (!drvdata)
    > + return -EINVAL;
    > + drvdata->ioreg = ioreg;
    > + spin_lock_init(&drvdata->reglock);
    > + platform_set_drvdata(pdev, drvdata);
    > + of_platform_bus_probe(np, of_anatop_subdevice_match, dev);
    > +
    > + return 0;
    > +}
    > +
    > +static int of_anatop_remove(struct platform_device *pdev)

    __devexit

    > +{
    > + struct anatop *drvdata;
    > + drvdata = platform_get_drvdata(pdev);
    > + iounmap(drvdata->ioreg);
    > + return 0;
    > +}
    > +

    --
    Regards,
    Shawn


    \
     
     \ /
      Last update: 2012-03-04 06:31    [W:0.022 / U:179.656 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site