Skip to contentSkip to conversation

PNP driver changes for 2.5.44

PATCH New Greg KH 1 participant 6 messages Oct 29, 2002

Subsystems (3)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 PNP driver changes for 2.5.44

Here's a set of updated PNP driver patches from Adam Belay.

Please pull from: bk://linuxusb.bkbits.net/pnp-2.5

thanks,

greg k-h

 drivers/pnp/compat.c        |   94 ----------------------------------------
 drivers/pnp/Config.in       |   16 +++---
 drivers/pnp/Makefile        |    4 -
 drivers/pnp/base.h          |    3 -
 drivers/pnp/core.c          |    5 --
 drivers/pnp/driver.c        |   19 ++++++--
 drivers/pnp/isapnp/Makefile |    4 -
 drivers/pnp/isapnp/compat.c |   94 ++++++++++++++++++++++++++++++++++++++++
 drivers/pnp/names.c         |    1 
 drivers/pnp/pnpbios/core.c  |  101 ++++++++++++++++++++++++++++++--------------
 drivers/pnp/quirks.c        |    1 
 drivers/pnp/resource.c      |   72 +++++++++++++++++++++++--------
 include/linux/pnp.h         |   62 ++++++++++++++++-----------
 sound/oss/ad1848.c          |    5 --
 sound/oss/cs4232.c          |   88 ++++++++++++++------------------------
 15 files changed, 317 insertions(+), 252 deletions(-)

-----

[email protected], 2002-10-28 21:30:10-08:00, [email protected]
merge

 include/linux/pnp.h |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

------

[email protected], 2002-10-24 00:27:01-07:00, [email protected]
[PATCH] update PnP layer to driver model changes - 2.5.44 (4/4)

Updates to the driver model changes. This should fix a potential panic.

 drivers/pnp/driver.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

------

[email protected], 2002-10-24 00:26:22-07:00, [email protected]
[PATCH] Convert CS4236B driver - 2.5.44 (3/4)

This patch converts the CS4236B sound card driver to the new PnP APIs. Also it makes pnp_driver_register return the number of matches during the driver add. This should serve as a sample driver, along with the serial and parport_pc.

 drivers/pnp/driver.c |   12 ++++++
 include/linux/pnp.h  |    1 
 sound/oss/ad1848.c   |    5 --
 sound/oss/cs4232.c   |   88 +++++++++++++++++++--------------------------------
 4 files changed, 45 insertions(+), 61 deletions(-)

------

[email protected], 2002-10-24 00:25:49-07:00, [email protected]
[PATCH] PnPBIOS changes - 2.5.44 (2/4)

This patch adds compatible PnP ID support to the PnPBIOS protocol. None of my test systems take advantage of this feature but it is included in the specifications so it makes sense to support it. If anyone does get a compatible ID listed for the PnPBIOS I'd be interested to hear about it (if more than 1 id is listed when viewing the driverfs file 'id' within the PnPBIOS protocol). Also it fixes the dma and mem resource problem.

 drivers/pnp/pnpbios/core.c |  101 +++++++++++++++++++++++++++++++--------------
 1 files changed, 70 insertions(+), 31 deletions(-)

------

[email protected], 2002-10-24 00:25:27-07:00, [email protected]
[PATCH] PnP cleanups and resource changes - 2.5.44 (1/4)

This patch fixes a number of things pointed out by Arne Thomassen. Also it makes a few changes to the resource checking functions in that they now check to make sure that resources do not conflict within the same device instead of only other devices. Although it is rare for this to be a factor it's nice to be able to deal with such situations properly.

 drivers/pnp/core.c          |    5 ---
 drivers/pnp/driver.c        |    3 -
 drivers/pnp/isapnp/compat.c |    1 
 drivers/pnp/names.c         |    1 
 drivers/pnp/quirks.c        |    1 
 drivers/pnp/resource.c      |   72 +++++++++++++++++++++++++++++++++-----------
 6 files changed, 57 insertions(+), 26 deletions(-)

------

[email protected], 2002-10-21 11:39:24-07:00, [email protected]
[PATCH] PnP Rewrite Fixes - 2.5.44

This patch addresses a few minor issues for the Linux Plug and Play Rewrite. It is against 2.5.44.

They are as follows.

1.) fix Config.in file - from Adrian Bunk and Roman Zippel
2.) if unable to activate a device the match should fail. This can be done now that the driver model matching bug has been corrected.
3.) move compat.c to isapnp directory and fix everything accordingly - suggested by Stelian Pop. This fixes a compile error if ISAPNP is disabled. 4.) fix a typo in pnp.h - patch from Skip Ford

Please Apply,
Adam

 drivers/pnp/compat.c        |   94 --------------------------------------------
 drivers/pnp/Config.in       |   16 ++++---
 drivers/pnp/Makefile        |    4 -
 drivers/pnp/base.h          |    3 -
 drivers/pnp/driver.c        |    2 
 drivers/pnp/isapnp/Makefile |    4 -
 drivers/pnp/isapnp/compat.c |   93 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/pnp.h         |   31 ++++++++------
 8 files changed, 126 insertions(+), 121 deletions(-)

------

author
#1 lore raw

PATCH 1/1 PNP driver changes for 2.5.44

ChangeSet 1.808.4.1, 2002/10/21 11:39:24-07:00, [email protected]

[PATCH] PnP Rewrite Fixes - 2.5.44

This patch addresses a few minor issues for the Linux Plug and Play Rewrite. It is against 2.5.44.

They are as follows.

1.) fix Config.in file - from Adrian Bunk and Roman Zippel
2.) if unable to activate a device the match should fail. This can be done now that the driver model matching bug has been corrected.
3.) move compat.c to isapnp directory and fix everything accordingly - suggested by Stelian Pop. This fixes a compile error if ISAPNP is disabled. 4.) fix a typo in pnp.h - patch from Skip Ford

Please Apply,
Adam

drivers/pnp/Config.in +9 -7
diff -Nru a/drivers/pnp/Config.in b/drivers/pnp/Config.in
@@ -4,15 +4,17 @@
 mainmenu_option next_comment
 comment 'Plug and Play configuration'
 
-dep_bool 'Plug and Play support' CONFIG_PNP
+bool 'Plug and Play support' CONFIG_PNP
 
-   dep_bool '  Plug and Play device name database' CONFIG_PNP_NAMES $CONFIG_PNP
-   dep_bool '  PnP Debug Messages' CONFIG_PNP_DEBUG $CONFIG_PNP
+if [ "$CONFIG_PNP" = "y" ]; then
+   bool '  Plug and Play device name database' CONFIG_PNP_NAMES
+   bool '  PnP Debug Messages' CONFIG_PNP_DEBUG
 
-comment 'Protocols' $CONFIG_PNP
+   comment 'Protocols'
 
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   dep_bool '  ISA Plug and Play support (EXPERIMENTAL)' CONFIG_ISAPNP $CONFIG_PNP
-   dep_bool '  Plug and Play BIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS $CONFIG_PNP
+   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+      bool '  ISA Plug and Play support (EXPERIMENTAL)' CONFIG_ISAPNP
+      bool '  Plug and Play BIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS
+   fi
 fi
 endmenu
drivers/pnp/Makefile +2 -2
diff -Nru a/drivers/pnp/Makefile b/drivers/pnp/Makefile
@@ -2,11 +2,11 @@
 # Makefile for the Linux Plug-and-Play Support.
 #
 
-obj-y		:= core.o driver.o resource.o interface.o quirks.o names.o compat.o system.o
+obj-y		:= core.o driver.o resource.o interface.o quirks.o names.o system.o
 
 obj-$(CONFIG_PNPBIOS)		+= pnpbios/
 obj-$(CONFIG_ISAPNP)		+= isapnp/
 
-export-objs	:= core.o driver.o resource.o compat.o
+export-objs	:= core.o driver.o resource.o
 
 include $(TOPDIR)/Rules.make
drivers/pnp/base.h +0 -3
diff -Nru a/drivers/pnp/base.h b/drivers/pnp/base.h
@@ -4,8 +4,5 @@
 extern int pnp_interface_attach_device(struct pnp_dev *dev);
 extern void pnp_name_device(struct pnp_dev *dev);
 extern void pnp_fixup_device(struct pnp_dev *dev);
-extern int compare_pnp_id(struct list_head * id_list, char * id);
 extern void pnp_free_ids(struct pnp_dev *dev);
 extern void pnp_free_resources(struct pnp_resources *resources);
-
-
drivers/pnp/compat.c deleted +0 -94

94 lines not on this page · raw message

drivers/pnp/driver.c +1 -1
diff -Nru a/drivers/pnp/driver.c b/drivers/pnp/driver.c
@@ -93,7 +93,7 @@
 
 	if (pnp_dev->active == 0)
 		if(pnp_activate_dev(pnp_dev)<0)
-			return 0;
+			return -1;
 	if (pnp_drv->probe && pnp_dev->active) {
 		if (pnp_dev->card && pnp_drv->card_id_table){
 			card_id = match_card(pnp_drv, pnp_dev->card);
drivers/pnp/isapnp/Makefile +2 -2
diff -Nru a/drivers/pnp/isapnp/Makefile b/drivers/pnp/isapnp/Makefile
@@ -2,10 +2,10 @@
 # Makefile for the kernel ISAPNP driver.
 #
 
-export-objs := core.o
+export-objs := core.o compat.o
 
 isapnp-proc-$(CONFIG_PROC_FS) = proc.o
 
-obj-y := core.o $(isapnp-proc-y)
+obj-y := core.o compat.o $(isapnp-proc-y)
 
 include $(TOPDIR)/Rules.make
drivers/pnp/isapnp/compat.c new file +93 -0

93 lines not on this page · raw message

include/linux/pnp.h +19 -12
diff -Nru a/include/linux/pnp.h b/include/linux/pnp.h
@@ -227,25 +227,16 @@
 int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode);
 
 /* driver */
+int compare_pnp_id(struct list_head * id_list, const char * id);
 int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
 int pnp_register_driver(struct pnp_driver *drv);
 void pnp_unregister_driver(struct pnp_driver *drv);
 
-/* compat */
-struct pnp_card *pnp_find_card(unsigned short vendor,
-				 unsigned short device,
-				 struct pnp_card *from);
-struct pnp_dev *pnp_find_dev(struct pnp_card *card,
-				unsigned short vendor,
-				unsigned short function,
-				struct pnp_dev *from);
-
-
 #else
 
 /* just in case anyone decides to call these without PnP Support Enabled */
 static inline int pnp_protocol_register(struct pnp_protocol *protocol) { return -ENODEV; }
-static inline void pnp_protocol_unregister(struct pnp_protocol *protocol) { ; )
+static inline void pnp_protocol_unregister(struct pnp_protocol *protocol) { ; }
 static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
 static inline void pnp_remove_device(struct pnp_dev *dev) { ; }
@@ -260,9 +251,25 @@
 static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode) { return -ENODEV; }
+static inline int compare_pnp_id(struct list_head * id_list, char * id) { return -ENODEV; }
 static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
 static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; }
+
+#endif /* CONFIG_PNP */
+
+#if defined(CONFIG_ISAPNP)
+/* compat */
+struct pnp_card *pnp_find_card(unsigned short vendor,
+				 unsigned short device,
+				 struct pnp_card *from);
+struct pnp_dev *pnp_find_dev(struct pnp_card *card,
+				unsigned short vendor,
+				unsigned short function,
+				struct pnp_dev *from);
+
+#else
+
 static inline struct pnp_card *pnp_find_card(unsigned short vendor,
 				 unsigned short device,
 				 struct pnp_card *from) { return NULL; }
@@ -271,7 +278,7 @@
 				unsigned short function,
 				struct pnp_dev *from) { return NULL; }
 
-#endif /* CONFIG_PNP */
+#endif /* CONFIG_ISAPNP */
 
 
 #ifdef DEBUG
author
#2 lore raw

ChangeSet 1.808.4.2, 2002/10/24 00:25:27-07:00, [email protected]

[PATCH] PnP cleanups and resource changes - 2.5.44 (1/4)

This patch fixes a number of things pointed out by Arne Thomassen. Also it makes a few changes to the resource checking functions in that they now check to make sure that resources do not conflict within the same device instead of only other devices. Although it is rare for this to be a factor it's nice to be able to deal with such situations properly.

drivers/pnp/core.c +1 -4
diff -Nru a/drivers/pnp/core.c b/drivers/pnp/core.c
@@ -82,7 +82,6 @@
 	list_del_init(&protocol->protocol_list);
 	spin_unlock(&pnp_lock);
 	device_unregister(&protocol->dev);
-	return;
 }
 
 /**
@@ -105,7 +104,6 @@
 		pnp_free_resources(dev->res);
 	pnp_free_ids(dev);
 	kfree(dev);
-	return;
 }
 
 /**
@@ -118,7 +116,7 @@
 int pnp_add_device(struct pnp_dev *dev)
 {
 	int error = 0;
-	if (!dev && !dev->protocol)
+	if (!dev || !dev->protocol)
 		return -EINVAL;
 	if (dev->card)
 		sprintf(dev->dev.bus_id, "%02x:%02x.%02x", dev->protocol->number,
@@ -158,7 +156,6 @@
 	list_del_init(&dev->global_list);
 	list_del_init(&dev->dev_list);
 	spin_unlock(&pnp_lock);
-	return;
 }
 
 static int __init pnp_init(void)
drivers/pnp/driver.c +1 -2
diff -Nru a/drivers/pnp/driver.c b/drivers/pnp/driver.c
@@ -150,7 +150,7 @@
 
 int pnp_register_driver(struct pnp_driver *drv)
 {
-	int count = 0;
+	int count;
 	pnp_dbg("the driver '%s' has been registered", drv->name);
 
 	drv->driver.name = drv->name;
@@ -194,7 +194,6 @@
 		struct pnp_id *pnp_id = to_pnp_id(pos);
 		kfree(pnp_id);
 	}
-	return;
 }
 
 EXPORT_SYMBOL(pnp_register_driver);
drivers/pnp/isapnp/compat.c +0 -1
diff -Nru a/drivers/pnp/isapnp/compat.c b/drivers/pnp/isapnp/compat.c
@@ -23,7 +23,6 @@
 			device & 0x0f,
 			(device >> 12) & 0x0f,
 			(device >> 8) & 0x0f);
-	return;
 }
 
 struct pnp_card *pnp_find_card(unsigned short vendor,
drivers/pnp/names.c +0 -1
diff -Nru a/drivers/pnp/names.c b/drivers/pnp/names.c
@@ -37,7 +37,6 @@
 			return;
 		}
 	}
-	return;
 }
 
 #else
drivers/pnp/quirks.c +0 -1
diff -Nru a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
@@ -164,6 +164,5 @@
 		}
 		i++;
 	}
-	return;
 }
 
drivers/pnp/resource.c +55 -17

191 lines not on this page · raw message

author
#3 lore raw

ChangeSet 1.808.4.3, 2002/10/24 00:25:49-07:00, [email protected]

[PATCH] PnPBIOS changes - 2.5.44 (2/4)

This patch adds compatible PnP ID support to the PnPBIOS protocol. None of my test systems take advantage of this feature but it is included in the specifications so it makes sense to support it. If anyone does get a compatible ID listed for the PnPBIOS I'd be interested to hear about it (if more than 1 id is listed when viewing the driverfs file 'id' within the PnPBIOS protocol). Also it fixes the dma and mem resource problem.

drivers/pnp/pnpbios/core.c +70 -31
diff -Nru a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
@@ -680,7 +680,7 @@
 
 static void add_dmaresource(struct pnp_dev *dev, int dma)
 {
-	int i = 8;
+	int i = 0;
 	while (!(dev->dma_resource[i].flags & IORESOURCE_UNSET) && i < DEVICE_COUNT_DMA) i++;
 	if (i < DEVICE_COUNT_DMA) {
 		dev->dma_resource[i].start = (unsigned long) dma;
@@ -701,7 +701,7 @@
 
 static void add_memresource(struct pnp_dev *dev, int mem, int len)
 {
-	int i = 0;
+	int i = 8;
 	while (!(dev->resource[i].flags & IORESOURCE_UNSET) && i < DEVICE_COUNT_RESOURCE) i++;
 	if (i < DEVICE_COUNT_RESOURCE) {
 		dev->resource[i].start = (unsigned long) mem;
@@ -816,6 +816,7 @@
         } /* while */
 	end:
 	if ((dev->resource[0].start == 0) &&
+	    (dev->resource[8].start == 0) &&
 	    (dev->irq_resource[0].start == -1) &&
 	    (dev->dma_resource[0].start == -1))
 		dev->active = 0;
@@ -927,7 +928,6 @@
 
 static unsigned char *node_possible_resource_data_to_dev(unsigned char *p, struct pnp_bios_node *node, struct pnp_dev *dev)
 {
-	unsigned char *lastp = NULL;
 	int len, depnum, dependent;
 
 	if ((char *)p == NULL)
@@ -963,8 +963,7 @@
 				break;
 			}
 			} /* switch */
-                        lastp = p+3;
-                        p = p + p[1] + p[2]*256 + 3;
+                        p += len + 3;
                         continue;
                 }
 		len = p[0] & 0x07;
@@ -1030,6 +1029,70 @@
         return NULL;
 }
 
+/* pnp EISA ids */
+
+#define HEX(id,a) hex[((id)>>a) & 15]
+#define CHAR(id,a) (0x40 + (((id)>>a) & 31))
+//
+
+static void inline pnpid32_to_pnpid(u32 id, char *str)
+{
+	const char *hex = "0123456789abcdef";
+
+	id = be32_to_cpu(id);
+	str[0] = CHAR(id, 26);
+	str[1] = CHAR(id, 21);
+	str[2] = CHAR(id,16);
+	str[3] = HEX(id, 12);
+	str[4] = HEX(id, 8);
+	str[5] = HEX(id, 4);
+	str[6] = HEX(id, 0);
+	str[7] = '\0';
+
+	return;
+}
+//
+#undef CHAR
+#undef HEX
+
+static void node_id_data_to_dev(unsigned char *p, struct pnp_bios_node *node, struct pnp_dev *dev)
+{
+	int len;
+	struct pnp_id *dev_id;
+
+	if ((char *)p == NULL)
+		return;
+        while ( (char *)p < ((char *)node->data + node->size )) {
+
+                if( p[0] & 0x80 ) {// large item
+			len = (p[2] << 8) | p[1];
+                        p += len + 3;
+                        continue;
+                }
+		len = p[0] & 0x07;
+                switch ((p[0]>>3) & 0x0f) {
+		case 0x0f:
+		{
+        		return;
+			break;
+		}
+                case 0x03: // compatible ID
+                {
+			if (len != 4)
+				goto __skip;
+			dev_id =  pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL);
+			if (!dev_id)
+				return;
+			pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << 24,dev_id->id);
+			pnp_add_id(dev_id, dev);
+			break;
+                }
+                } /* switch */
+		__skip:
+                p += len + 1;
+
+        } /* while */
+}
 
 /* pnp resource writing functions */
 
@@ -1314,31 +1377,6 @@
 	return 0;
 }
 
-#define HEX(id,a) hex[((id)>>a) & 15]
-#define CHAR(id,a) (0x40 + (((id)>>a) & 31))
-//
-
-static void inline pnpid32_to_pnpid(u32 id, char *str)
-{
-	const char *hex = "0123456789abcdef";
-
-	id = be32_to_cpu(id);
-	str[0] = CHAR(id, 26);
-	str[1] = CHAR(id, 21);
-	str[2] = CHAR(id,16);
-	str[3] = HEX(id, 12);
-	str[4] = HEX(id, 8);
-	str[5] = HEX(id, 4);
-	str[6] = HEX(id, 0);
-	str[7] = '\0';
-
-	return;
-}
-//
-#undef CHAR
-#undef HEX
-
-
 static void __init build_devlist(void)
 {
 	u8 nodenum;
@@ -1386,7 +1424,8 @@
 		memcpy(dev_id->id,id,8);
 		pnp_add_id(dev_id, dev);
 		pos = node_current_resource_data_to_dev(node,dev);
-		node_possible_resource_data_to_dev(pos,node,dev);
+		pos = node_possible_resource_data_to_dev(pos,node,dev);
+		node_id_data_to_dev(pos,node,dev);
 
 		dev->protocol = &pnpbios_protocol;
 
author
#4 lore raw

ChangeSet 1.808.4.4, 2002/10/24 00:26:22-07:00, [email protected]

[PATCH] Convert CS4236B driver - 2.5.44 (3/4)

This patch converts the CS4236B sound card driver to the new PnP APIs. Also it makes pnp_driver_register return the number of matches during the driver add. This should serve as a sample driver, along with the serial and parport_pc.

drivers/pnp/driver.c +11 -1
diff -Nru a/drivers/pnp/driver.c b/drivers/pnp/driver.c
@@ -151,6 +151,8 @@
 int pnp_register_driver(struct pnp_driver *drv)
 {
 	int count;
+	struct list_head *pos;
+
 	pnp_dbg("the driver '%s' has been registered", drv->name);
 
 	drv->driver.name = drv->name;
@@ -159,7 +161,15 @@
 	drv->driver.remove = pnp_device_remove;
 
 	count = driver_register(&drv->driver);
-	return count ? count : 1;
+
+	/* get the number of initial matches */
+	if (count >= 0){
+		count = 0;
+		list_for_each(pos,&drv->driver.devices){
+			count++;
+		}
+	}
+	return count;
 }
 
 void pnp_unregister_driver(struct pnp_driver *drv)
include/linux/pnp.h +0 -1
diff -Nru a/include/linux/pnp.h b/include/linux/pnp.h
@@ -94,7 +94,6 @@
 	int  (*probe)  (struct pnp_dev *dev, const struct pnp_id *card_id,
 		 	const struct pnp_id *dev_id);
 	void (*remove) (struct pnp_dev *dev);
-	struct device * (*legacy) (void);
 	struct device_driver	driver;
 };
 
sound/oss/ad1848.c +0 -5
diff -Nru a/sound/oss/ad1848.c b/sound/oss/ad1848.c
@@ -3026,8 +3026,6 @@
 {
 	char *busname = bus->name[0] ? bus->name : ad1848_isapnp_list[slot].name;
 
-	printk(KERN_INFO "ad1848: %s detected\n", busname);
-
 	/* Initialize this baby. */
 
 	if(ad1848_init_generic(bus, hw_config, slot)) {
@@ -3039,9 +3037,6 @@
 		       hw_config->dma2);
 		return 1;
 	}
-	else
-		printk(KERN_INFO "ad1848: Failed to initialize %s\n", busname);
-
 	return 0;
 }
 
sound/oss/cs4232.c +34 -54

179 lines not on this page · raw message

author
#5 lore raw

ChangeSet 1.808.4.5, 2002/10/24 00:27:01-07:00, [email protected]

[PATCH] update PnP layer to driver model changes - 2.5.44 (4/4)

Updates to the driver model changes. This should fix a potential panic.

drivers/pnp/driver.c +1 -1
diff -Nru a/drivers/pnp/driver.c b/drivers/pnp/driver.c
@@ -175,7 +175,7 @@
 void pnp_unregister_driver(struct pnp_driver *drv)
 {
 	pnp_dbg("the driver '%s' has been unregistered", drv->name);
-	remove_driver(&drv->driver);
+	driver_unregister(&drv->driver);
 }
 
 /**