Commit e9c14cd9 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/gregkh/linux/driver-2.6

into home.osdl.org:/home/torvalds/v2.5/linux
parents 339effbb 1308c2ac
...@@ -194,6 +194,12 @@ static void class_dev_release(struct kobject * kobj) ...@@ -194,6 +194,12 @@ static void class_dev_release(struct kobject * kobj)
if (cls->release) if (cls->release)
cls->release(cd); cls->release(cd);
else {
printk(KERN_ERR "Device class '%s' does not have a release() function, "
"it is broken and must be fixed.\n",
cd->class_id);
WARN_ON(1);
}
} }
static struct kobj_type ktype_class_device = { static struct kobj_type ktype_class_device = {
......
...@@ -78,6 +78,12 @@ static void device_release(struct kobject * kobj) ...@@ -78,6 +78,12 @@ static void device_release(struct kobject * kobj)
struct device * dev = to_dev(kobj); struct device * dev = to_dev(kobj);
if (dev->release) if (dev->release)
dev->release(dev); dev->release(dev);
else {
printk(KERN_ERR "Device '%s' does not have a release() function, "
"it is broken and must be fixed.\n",
dev->bus_id);
WARN_ON(1);
}
} }
static struct kobj_type ktype_device = { static struct kobj_type ktype_device = {
...@@ -211,8 +217,7 @@ int device_add(struct device *dev) ...@@ -211,8 +217,7 @@ int device_add(struct device *dev)
parent = get_device(dev->parent); parent = get_device(dev->parent);
pr_debug("DEV: registering device: ID = '%s', name = %s\n", pr_debug("DEV: registering device: ID = '%s'\n", dev->bus_id);
dev->bus_id, dev->name);
/* first, register with generic layer. */ /* first, register with generic layer. */
strlcpy(dev->kobj.name,dev->bus_id,KOBJ_NAME_LEN); strlcpy(dev->kobj.name,dev->bus_id,KOBJ_NAME_LEN);
...@@ -342,8 +347,7 @@ void device_del(struct device * dev) ...@@ -342,8 +347,7 @@ void device_del(struct device * dev)
*/ */
void device_unregister(struct device * dev) void device_unregister(struct device * dev)
{ {
pr_debug("DEV: Unregistering device. ID = '%s', name = '%s'\n", pr_debug("DEV: Unregistering device. ID = '%s'\n", dev->bus_id);
dev->bus_id,dev->name);
device_del(dev); device_del(dev);
put_device(dev); put_device(dev);
} }
......
...@@ -14,13 +14,6 @@ ...@@ -14,13 +14,6 @@
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/string.h> #include <linux/string.h>
static ssize_t device_read_name(struct device * dev, char * buf)
{
return sprintf(buf,"%s\n",dev->name);
}
static DEVICE_ATTR(name,S_IRUGO,device_read_name,NULL);
/** /**
* detach_state - control the default power state for the device. * detach_state - control the default power state for the device.
* *
...@@ -53,7 +46,6 @@ static DEVICE_ATTR(detach_state,0644,detach_show,detach_store); ...@@ -53,7 +46,6 @@ static DEVICE_ATTR(detach_state,0644,detach_show,detach_store);
struct attribute * dev_default_attrs[] = { struct attribute * dev_default_attrs[] = {
&dev_attr_name.attr,
&dev_attr_detach_state.attr, &dev_attr_detach_state.attr,
NULL, NULL,
}; };
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/init.h> #include <linux/init.h>
struct device legacy_bus = { struct device legacy_bus = {
.name = "legacy bus",
.bus_id = "legacy", .bus_id = "legacy",
}; };
......
...@@ -4232,9 +4232,6 @@ static int have_no_fdc= -ENODEV; ...@@ -4232,9 +4232,6 @@ static int have_no_fdc= -ENODEV;
static struct platform_device floppy_device = { static struct platform_device floppy_device = {
.name = "floppy", .name = "floppy",
.id = 0, .id = 0,
.dev = {
.name = "Floppy Drive",
},
}; };
static struct kobject *floppy_find(dev_t dev, int *part, void *data) static struct kobject *floppy_find(dev_t dev, int *part, void *data)
......
...@@ -648,7 +648,6 @@ static void hwif_register (ide_hwif_t *hwif) ...@@ -648,7 +648,6 @@ static void hwif_register (ide_hwif_t *hwif)
{ {
/* register with global device tree */ /* register with global device tree */
strlcpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE); strlcpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE);
snprintf(hwif->gendev.name,DEVICE_NAME_SIZE,"IDE Controller");
hwif->gendev.driver_data = hwif; hwif->gendev.driver_data = hwif;
if (hwif->pci_dev) if (hwif->pci_dev)
hwif->gendev.parent = &hwif->pci_dev->dev; hwif->gendev.parent = &hwif->pci_dev->dev;
...@@ -1217,8 +1216,6 @@ static void init_gendisk (ide_hwif_t *hwif) ...@@ -1217,8 +1216,6 @@ static void init_gendisk (ide_hwif_t *hwif)
ide_add_generic_settings(drive); ide_add_generic_settings(drive);
snprintf(drive->gendev.bus_id,BUS_ID_SIZE,"%u.%u", snprintf(drive->gendev.bus_id,BUS_ID_SIZE,"%u.%u",
hwif->index,unit); hwif->index,unit);
snprintf(drive->gendev.name,DEVICE_NAME_SIZE,
"%s","IDE Drive");
drive->gendev.parent = &hwif->gendev; drive->gendev.parent = &hwif->gendev;
drive->gendev.bus = &ide_bus_type; drive->gendev.bus = &ide_bus_type;
drive->gendev.driver_data = drive; drive->gendev.driver_data = drive;
......
...@@ -315,7 +315,7 @@ int __devinit init_bttv_i2c(struct bttv *btv) ...@@ -315,7 +315,7 @@ int __devinit init_bttv_i2c(struct bttv *btv)
memcpy(&btv->i2c_client, &bttv_i2c_client_template, memcpy(&btv->i2c_client, &bttv_i2c_client_template,
sizeof(struct i2c_client)); sizeof(struct i2c_client));
sprintf(btv->i2c_adap.dev.name, "bt848 #%d", btv->nr); sprintf(btv->i2c_adap.name, "bt848 #%d", btv->nr);
btv->i2c_adap.dev.parent = &btv->dev->dev; btv->i2c_adap.dev.parent = &btv->dev->dev;
btv->i2c_algo.data = btv; btv->i2c_algo.data = btv;
......
...@@ -1361,9 +1361,6 @@ static struct device_driver i82365_driver = { ...@@ -1361,9 +1361,6 @@ static struct device_driver i82365_driver = {
static struct platform_device i82365_device = { static struct platform_device i82365_device = {
.name = "i82365", .name = "i82365",
.id = 0, .id = 0,
.dev = {
.name = "i82365",
},
}; };
static int __init init_i82365(void) static int __init init_i82365(void)
......
...@@ -372,9 +372,6 @@ static struct device_driver tcic_driver = { ...@@ -372,9 +372,6 @@ static struct device_driver tcic_driver = {
static struct platform_device tcic_device = { static struct platform_device tcic_device = {
.name = "tcic-pcmcia", .name = "tcic-pcmcia",
.id = 0, .id = 0,
.dev = {
.name = "tcic-pcmcia",
},
}; };
......
...@@ -899,7 +899,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -899,7 +899,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
/* We must finish initialization here */ /* We must finish initialization here */
if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, socket->dev->dev.name, socket)) { if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, pci_name(socket->dev), socket)) {
/* No IRQ or request_irq failed. Poll */ /* No IRQ or request_irq failed. Poll */
socket->cb_irq = 0; /* But zero is a valid IRQ number. */ socket->cb_irq = 0; /* But zero is a valid IRQ number. */
init_timer(&socket->poll_timer); init_timer(&socket->poll_timer);
......
...@@ -1566,7 +1566,6 @@ device_initcall(scsi_debug_init); ...@@ -1566,7 +1566,6 @@ device_initcall(scsi_debug_init);
module_exit(scsi_debug_exit); module_exit(scsi_debug_exit);
static struct device pseudo_primary = { static struct device pseudo_primary = {
.name = "Host/Pseudo Bridge",
.bus_id = "pseudo_0", .bus_id = "pseudo_0",
}; };
...@@ -1630,7 +1629,6 @@ static int sdebug_add_adapter() ...@@ -1630,7 +1629,6 @@ static int sdebug_add_adapter()
sdbg_host->dev.bus = &pseudo_lld_bus; sdbg_host->dev.bus = &pseudo_lld_bus;
sdbg_host->dev.parent = &pseudo_primary; sdbg_host->dev.parent = &pseudo_primary;
sdbg_host->dev.release = &sdebug_release_adapter; sdbg_host->dev.release = &sdebug_release_adapter;
sprintf(sdbg_host->dev.name, "scsi debug adapter");
sprintf(sdbg_host->dev.bus_id, "adapter%d", scsi_debug_add_host); sprintf(sdbg_host->dev.bus_id, "adapter%d", scsi_debug_add_host);
error = device_register(&sdbg_host->dev); error = device_register(&sdbg_host->dev);
......
...@@ -447,24 +447,6 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result, ...@@ -447,24 +447,6 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result,
return; return;
} }
static void scsi_set_name(struct scsi_device *sdev, char *inq_result)
{
int i;
char type[72];
i = inq_result[0] & 0x1f;
if (i < MAX_SCSI_DEVICE_CODE)
strcpy(type, scsi_device_types[i]);
else
strcpy(type, "Unknown");
i = strlen(type) - 1;
while (i >= 0 && type[i] == ' ')
type[i--] = '\0';
snprintf(sdev->sdev_gendev.name, DEVICE_NAME_SIZE, "SCSI %s", type);
}
/** /**
* scsi_add_lun - allocate and fully initialze a Scsi_Device * scsi_add_lun - allocate and fully initialze a Scsi_Device
* @sdevscan: holds information to be stored in the new Scsi_Device * @sdevscan: holds information to be stored in the new Scsi_Device
...@@ -539,8 +521,6 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) ...@@ -539,8 +521,6 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
printk(KERN_INFO "scsi: unknown device type %d\n", sdev->type); printk(KERN_INFO "scsi: unknown device type %d\n", sdev->type);
} }
scsi_set_name(sdev, inq_result);
print_inquiry(inq_result); print_inquiry(inq_result);
/* /*
......
...@@ -408,8 +408,6 @@ void scsi_sysfs_init_host(struct Scsi_Host *shost) ...@@ -408,8 +408,6 @@ void scsi_sysfs_init_host(struct Scsi_Host *shost)
device_initialize(&shost->shost_gendev); device_initialize(&shost->shost_gendev);
snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d",
shost->host_no); shost->host_no);
snprintf(shost->shost_gendev.name, DEVICE_NAME_SIZE, "%s",
shost->hostt->proc_name);
shost->shost_gendev.release = scsi_host_dev_release; shost->shost_gendev.release = scsi_host_dev_release;
class_device_initialize(&shost->shost_classdev); class_device_initialize(&shost->shost_classdev);
......
...@@ -254,7 +254,6 @@ struct device { ...@@ -254,7 +254,6 @@ struct device {
struct device * parent; struct device * parent;
struct kobject kobj; struct kobject kobj;
char name[DEVICE_NAME_SIZE]; /* descriptive ascii string */
char bus_id[BUS_ID_SIZE]; /* position on parent bus */ char bus_id[BUS_ID_SIZE]; /* position on parent bus */
struct bus_type * bus; /* type of bus device is on */ struct bus_type * bus; /* type of bus device is on */
......
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