* [patch 1/1] Audit return code : drivers/macintosh/apm_emu.c
@ 2005-06-30 22:03 domen
2005-07-01 0:27 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: domen @ 2005-06-30 22:03 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, domen, Christophe Lucas
From: Christophe Lucas <clucas@rotomalug.org>
Audit return codes (and handle failure correctly) for misc_register.
Signed-off-by: Christophe Lucas <clucas@rotomalug.org>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
apm_emu.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
Index: quilt/drivers/macintosh/apm_emu.c
===================================================================
--- quilt.orig/drivers/macintosh/apm_emu.c
+++ quilt/drivers/macintosh/apm_emu.c
@@ -515,19 +515,24 @@ static struct miscdevice apm_device = {
static int __init apm_emu_init(void)
{
+ int ret;
struct proc_dir_entry *apm_proc;
if (sys_ctrler != SYS_CTRLER_PMU) {
printk(KERN_INFO "apm_emu: Requires a machine with a PMU.\n");
return -ENODEV;
}
-
+
+ ret = misc_register(&apm_device);
+ if (ret) {
+ printk(KERN_WARNING "apm_emu: Unable to register misc device.\n");
+ return ret;
+ }
+
apm_proc = create_proc_info_entry("apm", 0, NULL, apm_emu_get_info);
if (apm_proc)
apm_proc->owner = THIS_MODULE;
- misc_register(&apm_device);
-
pmu_register_sleep_notifier(&apm_sleep_notifier);
printk(KERN_INFO "apm_emu: APM Emulation %s initialized.\n", driver_version);
--
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch 1/1] Audit return code : drivers/macintosh/apm_emu.c
2005-06-30 22:03 [patch 1/1] Audit return code : drivers/macintosh/apm_emu.c domen
@ 2005-07-01 0:27 ` Stephen Rothwell
2005-07-01 0:51 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2005-07-01 0:27 UTC (permalink / raw)
To: domen; +Cc: clucas, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 508 bytes --]
On Fri, 01 Jul 2005 00:03:50 +0200 domen@coderock.org wrote:
>
> From: Christophe Lucas <clucas@rotomalug.org>
>
>
> Audit return codes (and handle failure correctly) for misc_register.
This patch was rejected against arch/i386/kernel/apm.c since the driver
can still do useful things even if the misc_register fails. (I don't know
if this is true for the ppc emulation, just a note).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 1/1] Audit return code : drivers/macintosh/apm_emu.c
2005-07-01 0:27 ` Stephen Rothwell
@ 2005-07-01 0:51 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2005-07-01 0:51 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, domen, clucas
On Fri, 2005-07-01 at 10:27 +1000, Stephen Rothwell wrote:
> On Fri, 01 Jul 2005 00:03:50 +0200 domen@coderock.org wrote:
> >
> > From: Christophe Lucas <clucas@rotomalug.org>
> >
> >
> > Audit return codes (and handle failure correctly) for misc_register.
>
> This patch was rejected against arch/i386/kernel/apm.c since the driver
> can still do useful things even if the misc_register fails. (I don't know
> if this is true for the ppc emulation, just a note).
Yes same for ppc, we still have the /proc entry which is useful.
Ben.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-01 0:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-30 22:03 [patch 1/1] Audit return code : drivers/macintosh/apm_emu.c domen
2005-07-01 0:27 ` Stephen Rothwell
2005-07-01 0:51 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).