Skip to contentSkip to conversation

remove explicit k_name use in atmel_cs.c, bt3c_cs.c

PATCH In review Andries Brouwer 2 participants 2 messages Nov 10, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove explicit k_name use in atmel_cs.c, bt3c_cs.c

drivers/bluetooth/bt3c_cs.c +1 -4
diff -uprN -X /linux/dontdiff a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
@@ -489,13 +489,10 @@ static int bt3c_hci_ioctl(struct hci_dev
 
 static struct device *bt3c_device(void)
 {
-	static char *kobj_name = "bt3c";
-
 	static struct device dev = {
 		.bus_id = "pcmcia",
 	};
-	dev.kobj.k_name = kmalloc(strlen(kobj_name) + 1, GFP_KERNEL);
-	strcpy(dev.kobj.k_name, kobj_name);
+	kobject_set_name(&dev.kobj, "bt3c");
 	kobject_init(&dev.kobj);
 
 	return &dev;
drivers/net/wireless/atmel_cs.c +1 -4
diff -uprN -X /linux/dontdiff a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
@@ -350,13 +350,10 @@ static struct { 
 /* This is strictly temporary, until PCMCIA devices get integrated into the device model. */
 static struct device *atmel_device(void)
 {
-	static char *kobj_name = "atmel_cs";
-
 	static struct device dev = {
 		.bus_id    = "pcmcia",
 	};
-	dev.kobj.k_name = kmalloc(strlen(kobj_name)+1, GFP_KERNEL);
-	strcpy(dev.kobj.k_name, kobj_name);
+	kobject_set_name(&dev.kobj, "atmel_cs");
 	kobject_init(&dev.kobj);
 	
 	return &dev;
maintainer
#1 lore raw
Quoted 8 lines

diff -uprN -X /linux/dontdiff a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c

drivers/bluetooth/bt3c_cs.c +0 -1
@@ -489,13 +489,10 @@ static int bt3c_hci_ioctl(struct hci_dev
 
 static struct device *bt3c_device(void)
 {
-	static char *kobj_name = "bt3c";

drivers/bluetooth/bt3c_cs.c static int bt3c_hci_ioctl(struct hci_dev · line 498

Quoted 10 lines
drivers/bluetooth/bt3c_cs.c +1 -3
-
 	static struct device dev = {
 		.bus_id = "pcmcia",
 	};
-	dev.kobj.k_name = kmalloc(strlen(kobj_name) + 1, GFP_KERNEL);
-	strcpy(dev.kobj.k_name, kobj_name);
+	kobject_set_name(&dev.kobj, "bt3c");
 	kobject_init(&dev.kobj);
 
 	return &dev;

The part for the bt3c_cs driver is fine with me and I have no problem if Andrew picks this up and sends it to Linus for final inclusion. Once the PCMCIA subsystem if fully integrated into the device model this will go away anyway.