lkml.org 
[lkml]   [2008]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH/HP7XX] - Add combined LCD / BL driver for platform HP Jornada 7xx handhelds
    On Wed, Feb 06, 2008 at 08:21:28PM +0100, Kristoffer Ericson wrote:
    > Oh, and thanks for all the feedback people! (and for doing it nicely)

    I'm afraid you missed one - and there's a better fix for one of the other
    points I made... 8)

    > +static int jornada_bl_probe(struct platform_device *pdev)
    > +{
    > + struct bllcd_device *bllcd;

    int ret;

    > +
    > + bllcd = kzalloc(sizeof(*bllcd), GFP_KERNEL);
    > + if (bllcd == NULL)
    > + return -ENOMEM;
    > +
    > + /* bl driver - name must match fb driver name */
    > + bllcd->bl_device = backlight_device_register(S1D_DEVICENAME,
    > + &pdev->dev, NULL, &jornada_bl_ops);
    > +
    > + if (IS_ERR(bllcd->bl_device)) {

    ret = PTR_ERR(bllcd->bl_device);

    > + kfree(bllcd);
    > + printk(KERN_ERR "bl :failed to register device\n");
    > + return -ENODEV;

    delete the line above, and then swap the two remaining lines.

    return ret;

    > + }
    > +
    > + /* lcd driver */
    > + bllcd->lcd_device = lcd_device_register(S1D_DEVICENAME,
    > + &pdev->dev, NULL, &jornada_lcd_ops);
    > + if (IS_ERR(bllcd->lcd_device)) {
    > + backlight_device_unregister(bllcd->bl_device);

    ret = PTR_ERR(bllcd->lcd_device);

    > + kfree(bllcd);
    > + printk(KERN_ERR "lcd :failed to register device\n");
    > + return -ENODEV;

    delete the line above, and then swap the two remaining lines.

    return ret;

    The reason for swapping the two lines is that it _might_ give gcc a
    chance to optimise the two paths.

    > +static struct platform_driver jornada_bl_driver = {
    > + .probe = jornada_bl_probe,
    > + .remove = jornada_bl_remove,
    > +#ifdef CONFIG_PM
    > + .suspend = jornada_bl_suspend,
    > + .resume = jornada_bl_resume,
    > +#endif
    > + .driver = {
    > + .name = "jornada_bllcd",

    You missed this one - which currently is: tab space space space space.
    It should be two tabs.


    \
     
     \ /
      Last update: 2008-02-06 20:35    [W:0.035 / U:92.524 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site