From: Felipe Balbi <felipe.balbi@nokia.com>
To: ext Andrew de Quincey <adq@lidskialf.net>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: Patch: Init/shutdown correctness fixes for drivers/cbus/retu*
Date: Thu, 11 Jun 2009 12:33:28 +0300 [thread overview]
Message-ID: <20090611093328.GA15374@nokia.com> (raw)
In-Reply-To: <20090526001856.117145k514vqy2kg@lidskialf.net>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 3135 bytes --]
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@lidskialf.net>
> 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ölä
> + * 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ölä");
> +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@elektrobit.com>
> *
> - * Contact Juha Yrjölä <juha.yrjola@nokia.com>
> + * Contact Juha Yrj�l� <juha.yrjola@nokia.com>
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-06-11 9:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 23:18 Patch: Init/shutdown correctness fixes for drivers/cbus/retu* Andrew de Quincey
2009-06-11 9:33 ` Felipe Balbi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090611093328.GA15374@nokia.com \
--to=felipe.balbi@nokia.com \
--cc=adq@lidskialf.net \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.