Commit 8656699f authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[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.
parent 6169c8c2
......@@ -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);
......
......@@ -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");
......
......@@ -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;
......
......@@ -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)) {
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment