lkml.org 
[lkml]   [2008]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] leds: implement OpenFirmare GPIO LED driver
    Hello Stephen,

    On Tue, Jul 15, 2008 at 01:10:04PM +1000, Stephen Rothwell wrote:
    [...]
    > > + led->np = np;
    >
    > You need to take a reference if you are keeping a pointer to a
    > device_node, so:
    > led->np = of_node_get(np);
    >
    > > + led->cdev.name = of_get_property(np, "label", NULL);
    > > + if (!led->cdev.name)
    > > + led->cdev.name = ofdev->dev.bus_id;
    >
    > Please use dev_name() in new code:
    > led->cdev.name = dev_name(&ofdev->dev);
    >
    > > + led->cdev.brightness_set = gpio_led_set;
    > > +
    > > + ret = gpio_request(led->gpio, ofdev->dev.bus_id);
    >
    > dev_name() again.
    >
    > > +err_get_gpio:
    >
    > of_node_put(led->np);
    >
    > > + kfree(led);
    > > + return ret;
    > > +}
    > > +
    > > +static int __devexit of_gpio_leds_remove(struct of_device *ofdev)
    > > +{
    > > + struct of_gpio_led *led = dev_get_drvdata(&ofdev->dev);
    > > +
    > > + led_classdev_unregister(&led->cdev);
    > > + cancel_work_sync(&led->work);
    > > + gpio_free(led->gpio);
    > > + of_node_put(led->np);
    >
    > This was going to be unbalanced, but is now correct.

    Thank you so much for the review, corrected version follows.

    --
    Anton Vorontsov
    email: cbouatmailru@gmail.com
    irc://irc.freenode.net/bd2


    \
     
     \ /
      Last update: 2008-07-15 14:41    [W:0.022 / U:0.304 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site