Hi, On Tue, May 26, 2009 at 01:18:56AM +0200, ext Andrew de Quincey wrote: > I noticed there were a number of problems with the init and shutdown > routines for the code in drivers/cbus/retu*. This patch (for review) > attempts to fix them. please, next time make your patch inline, it's easier to reply to it. Content-Description: retu-correctness.patch > commit 59e589227131abbe5e07576f542cc35a8821c9d3 > Author: Andrew de Quincey <adq@xxxxxxxxxxxxx> > Date: Mon May 25 23:58:27 2009 +0100 > > Correctness fixes for the retu drivers > > diff --git a/drivers/cbus/retu-headset.c b/drivers/cbus/retu-headset.c > index e798bc2..fe8266f 100644 > --- a/drivers/cbus/retu-headset.c > +++ b/drivers/cbus/retu-headset.c > @@ -3,7 +3,7 @@ > * > * Copyright (C) 2006 Nokia Corporation > * > - * Written by Juha Yrj�> + * Written by Juha Yrj�l� revert this line. > @@ -352,4 +355,4 @@ module_exit(retu_headset_exit); > > MODULE_DESCRIPTION("Retu/Vilma headset detection"); > MODULE_LICENSE("GPL"); > -MODULE_AUTHOR("Juha Yrj�); > +MODULE_AUTHOR("Juha Yrj�l�"); and this > diff --git a/drivers/cbus/retu-pwrbutton.c b/drivers/cbus/retu-pwrbutton.c > index 38d7aa4..cc47691 100644 > --- a/drivers/cbus/retu-pwrbutton.c > +++ b/drivers/cbus/retu-pwrbutton.c > @@ -7,7 +7,7 @@ > * > * Written by Ari Saastamoinen <ari.saastamoinen@xxxxxxxxxxxxxx> > * > - * Contact Juha Yrj�<juha.yrjola@xxxxxxxxx> > + * Contact Juha Yrj�l� <juha.yrjola@xxxxxxxxx> and this > @@ -75,29 +75,40 @@ static void retubutton_irq(unsigned long arg) > */ > static int __init retubutton_init(void) > { > - int irq; > - > - printk(KERN_INFO "Retu power button driver initialized\n"); > - irq = RETU_INT_PWR; > + int ret; > > init_timer(&pwrbtn_timer); > pwrbtn_timer.function = retubutton_timer_func; > > - if (retu_request_irq(irq, &retubutton_irq, 0, "PwrOnX") < 0) { > + if (retu_request_irq(RETU_INT_PWR, &retubutton_irq, 0, "PwrOnX") < 0) { > + del_timer_sync(&pwrbtn_timer); > printk(KERN_ERR "%s@%s: Cannot allocate irq\n", > __FUNCTION__, __FILE__); > return -EBUSY; > } > > pwrbtn_dev = input_allocate_device(); > - if (!pwrbtn_dev) > + if (!pwrbtn_dev) { > + retu_free_irq(RETU_INT_PWR); > + del_timer_sync(&pwrbtn_timer); > return -ENOMEM; > + } > > pwrbtn_dev->evbit[0] = BIT_MASK(EV_KEY); > pwrbtn_dev->keybit[BIT_WORD(KEY_POWER)] = BIT_MASK(KEY_POWER); > pwrbtn_dev->name = "retu-pwrbutton"; > > - return input_register_device(pwrbtn_dev); > + ret = input_register_device(pwrbtn_dev); > + if (ret < 0) { > + retu_free_irq(RETU_INT_PWR); > + del_timer_sync(&pwrbtn_timer); > + input_free_device(pwrbtn_dev); > + return ret; > + } > + > + printk(KERN_INFO "Retu power button driver initialized\n"); no printk(). boot is already noisy enough. -- balbi -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html