[RFC PATCH 4/11] pcmcia/ds: driver layer error checking
Dominik Brodowski
linux at dominikbrodowski.net
Wed Oct 25 22:13:53 EDT 2006
From: Randy Dunlap <rdunlap at xenotime.net>
Date: Fri, 20 Oct 2006 14:44:12 -0700
Subject: [PATCH] pcmcia/ds: driver layer error checking
Check driver layer return values in pcmcia/ds.c
Signed-off-by: Randy Dunlap <rdunlap at xenotime.net>
Signed-off-by: Andrew Morton <akpm at osdl.org>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
drivers/pcmcia/ds.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 74b3124..af392bf 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1292,10 +1292,22 @@ struct bus_type pcmcia_bus_type = {
static int __init init_pcmcia_bus(void)
{
+ int ret;
+
spin_lock_init(&pcmcia_dev_list_lock);
- bus_register(&pcmcia_bus_type);
- class_interface_register(&pcmcia_bus_interface);
+ ret = bus_register(&pcmcia_bus_type);
+ if (ret < 0) {
+ printk(KERN_WARNING "pcmcia: bus_register error: %d\n", ret);
+ return ret;
+ }
+ ret = class_interface_register(&pcmcia_bus_interface);
+ if (ret < 0) {
+ printk(KERN_WARNING
+ "pcmcia: class_interface_register error: %d\n", ret);
+ bus_unregister(&pcmcia_bus_type);
+ return ret;
+ }
pcmcia_setup_ioctl();
--
1.4.3
More information about the linux-pcmcia
mailing list