From: Mikael Pettersson <mikpe@it.uu.se>
To: amol@verismonetworks.com, kernel-janitors@lists.osdl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc_register error return handling
Date: Mon, 25 Sep 2006 13:18:27 +0200 (MEST) [thread overview]
Message-ID: <200609251118.k8PBIRec000783@harpo.it.uu.se> (raw)
On Mon, 25 Sep 2006 14:29:00 +0530, Amol Lad wrote:
> diff -uprN -X linux-2.6.18-orig/Documentation/dontdiff linux-2.6.18-orig/arch/i386/kernel/apm.c linux-2.6.18/arch/i386/kernel/apm.c
> --- linux-2.6.18-orig/arch/i386/kernel/apm.c 2006-09-21 10:15:25.000000000 +0530
> +++ linux-2.6.18/arch/i386/kernel/apm.c 2006-09-25 13:59:53.000000000 +0530
> @@ -2246,6 +2246,12 @@ static int __init apm_init(void)
> return -ENODEV;
> }
>
> + ret = misc_register(&apm_device);
> + if (ret != 0) {
> + printk(KERN_ERR "apm: cannot register misc device.\n");
> + return ret;
> + }
> +
> if (allow_ints)
> apm_info.allow_ints = 1;
> if (broken_psr)
> @@ -2282,17 +2288,20 @@ static int __init apm_init(void)
>
> if (apm_info.disabled) {
> printk(KERN_NOTICE "apm: disabled on user request.\n");
> - return -ENODEV;
> + ret = -ENODEV;
> + goto out_misc;
etc
NAK on the APM changes. APM can do its work just fine even if
it failed to register a device file; it will just lack some
user interface/control bits.
> @@ -2348,8 +2358,6 @@ static int __init apm_init(void)
> return 0;
> }
>
> - misc_register(&apm_device);
> -
This should just print a warning (but not fail) if misc_register()
returned failure.
/Mikael
next reply other threads:[~2006-09-25 11:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-25 11:18 Mikael Pettersson [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-09-25 8:59 Amol Lad
2006-09-25 8:43 Amol Lad
2006-09-25 13:02 ` Stephen Rothwell
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=200609251118.k8PBIRec000783@harpo.it.uu.se \
--to=mikpe@it.uu.se \
--cc=amol@verismonetworks.com \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®