Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-03-07 00:44:55 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-07 00:44:55 -0800
commit8656699fa8ec57e222af910749978cfcfb1cd821 (patch)
treed9e20aa9f07b400291d16fa365f493c0ee0252f2
parent6169c8c298be000da38ffe67a59e7f27bd34b802 (diff)
[PATCH] misc_register/request_region
These are the small subset which were obviously correct. Evgeniy Polyakov <johnpol@2ka.mipt.ru>: Patches check return values for request_region() and misc_register(). This patches make janitorial project TODO list a bit smaller.
-rw-r--r--arch/mips64/sgi-ip27/ip27-rtc.c3
-rw-r--r--arch/ppc/iSeries/rtc.c3
-rw-r--r--drivers/acorn/char/mouse_ps2.c3
-rw-r--r--drivers/acorn/scsi/ecoscsi.c6
-rw-r--r--drivers/char/acquirewdt.c3
-rw-r--r--drivers/isdn/act2000/act2000_isa.c3
6 files changed, 15 insertions, 6 deletions
diff --git a/arch/mips64/sgi-ip27/ip27-rtc.c b/arch/mips64/sgi-ip27/ip27-rtc.c
index c893d10cfe67..a44ad0fccbad 100644
--- a/arch/mips64/sgi-ip27/ip27-rtc.c
+++ b/arch/mips64/sgi-ip27/ip27-rtc.c
@@ -201,7 +201,8 @@ static int __init rtc_init(void)
KL_CONFIG_CH_CONS_INFO(nid)->memory_base + IOC3_BYTEBUS_DEV0;
printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
- misc_register(&rtc_dev);
+ if (misc_register(&rtc_dev))
+ return -ENODEV;
create_proc_read_entry ("rtc", 0, NULL, rtc_read_proc, NULL);
save_flags(flags);
diff --git a/arch/ppc/iSeries/rtc.c b/arch/ppc/iSeries/rtc.c
index 55e1861d4158..78461ff14d6f 100644
--- a/arch/ppc/iSeries/rtc.c
+++ b/arch/ppc/iSeries/rtc.c
@@ -192,7 +192,8 @@ static struct miscdevice rtc_dev=
static int __init rtc_init(void)
{
- misc_register(&rtc_dev);
+ if (misc_register(&rtc_dev))
+ return -ENODEV;
create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL);
printk(KERN_INFO "iSeries Real Time Clock Driver v" RTC_VERSION "\n");
diff --git a/drivers/acorn/char/mouse_ps2.c b/drivers/acorn/char/mouse_ps2.c
index 544e7cf5e2a5..0b00b556ff1f 100644
--- a/drivers/acorn/char/mouse_ps2.c
+++ b/drivers/acorn/char/mouse_ps2.c
@@ -271,7 +271,8 @@ int __init psaux_init(void)
iomd_writeb(0, IOMD_MSECTL);
iomd_writeb(8, IOMD_MSECTL);
- misc_register(&psaux_mouse);
+ if (misc_register(&psaux_mouse))
+ return -ENODEV;
queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
memset(queue, 0, sizeof(*queue));
queue->head = queue->tail = 0;
diff --git a/drivers/acorn/scsi/ecoscsi.c b/drivers/acorn/scsi/ecoscsi.c
index a605212d2e64..0e283b20d076 100644
--- a/drivers/acorn/scsi/ecoscsi.c
+++ b/drivers/acorn/scsi/ecoscsi.c
@@ -125,7 +125,11 @@ int ecoscsi_detect(Scsi_Host_Template * tpnt)
}
NCR5380_init(instance, 0);
- request_region (instance->io_port, instance->n_io_port, "ecoscsi");
+ if (request_region (instance->io_port, instance->n_io_port, "ecoscsi") == NULL)
+ {
+ scsi_unregister(instance);
+ return 0;
+ }
if (instance->irq != IRQ_NONE)
if (request_irq(instance->irq, do_ecoscsi_intr, SA_INTERRUPT, "ecoscsi", NULL)) {
diff --git a/drivers/char/acquirewdt.c b/drivers/char/acquirewdt.c
index df2938ade0da..37a3420c9285 100644
--- a/drivers/char/acquirewdt.c
+++ b/drivers/char/acquirewdt.c
@@ -207,7 +207,8 @@ static int __init acq_init(void)
printk("WDT driver for Acquire single board computer initialising.\n");
spin_lock_init(&acq_lock);
- misc_register(&acq_miscdev);
+ if (misc_register(&acq_miscdev))
+ return -ENODEV;
request_region(WDT_STOP, 1, "Acquire WDT");
request_region(WDT_START, 1, "Acquire WDT");
register_reboot_notifier(&acq_notifier);
diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c
index 5bde8e15689c..136d3a346204 100644
--- a/drivers/isdn/act2000/act2000_isa.c
+++ b/drivers/isdn/act2000/act2000_isa.c
@@ -178,7 +178,8 @@ act2000_isa_config_port(act2000_card * card, unsigned short portbase)
card->flags &= ~ACT2000_FLAGS_PVALID;
}
if (!check_region(portbase, ISA_REGION)) {
- request_region(portbase, ACT2000_PORTLEN, card->regname);
+ if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
+ return -EIO;
card->port = portbase;
card->flags |= ACT2000_FLAGS_PVALID;
return 0;