diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-06 21:59:47 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-06 21:59:47 -0700 |
| commit | 46f787599c5467f53c0cbe717a78e25555fe8926 (patch) | |
| tree | 676a1a6b993bedd9b3c888733a1b9e635cb0274e | |
| parent | 31f00c29edc1cb5b661e2b34a7c222d99fa34fff (diff) | |
| download | patches-46f787599c5467f53c0cbe717a78e25555fe8926.tar.gz | |
2.6.26-rc1-git4 resync and updates from Kay
9 files changed, 1045 insertions, 125 deletions
diff --git a/driver-core/add-device-api-without-20-char-limit.patch b/driver-core/add-device-api-without-20-char-limit.patch index 19777d39d9dc00..17c8965a893884 100644 --- a/driver-core/add-device-api-without-20-char-limit.patch +++ b/driver-core/add-device-api-without-20-char-limit.patch @@ -12,13 +12,23 @@ Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- - drivers/base/core.c | 76 ++++++++++++++++++++++++++++++++++++++++++------- + drivers/base/core.c | 79 ++++++++++++++++++++++++++++++++++++++++++------- include/linux/device.h | 13 ++++++-- - 2 files changed, 76 insertions(+), 13 deletions(-) + 2 files changed, 79 insertions(+), 13 deletions(-) --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -809,6 +809,47 @@ static void device_remove_sys_dev_entry( +@@ -109,6 +109,9 @@ static void device_release(struct kobjec + { + struct device *dev = to_dev(kobj); + ++ /* possibly clean init_name, in case we did not add the device */ ++ dev_set_name(dev, NULL); ++ + if (dev->release) + dev->release(dev); + else if (dev->type && dev->type->release) +@@ -809,6 +812,47 @@ static void device_remove_sys_dev_entry( } } @@ -66,7 +76,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> /** * device_add - add device to device hierarchy. * @dev: device. -@@ -827,12 +868,22 @@ int device_add(struct device *dev) +@@ -827,12 +871,22 @@ int device_add(struct device *dev) int error; dev = get_device(dev); @@ -91,7 +101,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> parent = get_device(dev->parent); setup_parent(dev, parent); -@@ -841,16 +892,16 @@ int device_add(struct device *dev) +@@ -841,16 +895,16 @@ int device_add(struct device *dev) if (parent) set_dev_node(dev, dev_to_node(parent)); @@ -112,7 +122,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (dev->bus) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, BUS_NOTIFY_ADD_DEVICE, dev); -@@ -900,6 +951,7 @@ int device_add(struct device *dev) +@@ -900,6 +954,7 @@ int device_add(struct device *dev) Done: put_device(dev); return error; @@ -120,7 +130,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> PMError: bus_remove_device(dev); BusError: -@@ -1184,7 +1236,7 @@ static void device_create_release(struct +@@ -1184,7 +1239,7 @@ static void device_create_release(struct struct device *device_create(struct class *class, struct device *parent, dev_t devt, const char *fmt, ...) { @@ -129,7 +139,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> struct device *dev = NULL; int retval = -ENODEV; -@@ -1202,9 +1254,12 @@ struct device *device_create(struct clas +@@ -1202,9 +1257,12 @@ struct device *device_create(struct clas dev->parent = parent; dev->release = device_create_release; @@ -145,7 +155,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> retval = device_register(dev); if (retval) goto error; -@@ -1212,6 +1267,7 @@ struct device *device_create(struct clas +@@ -1212,6 +1270,7 @@ struct device *device_create(struct clas return dev; error: diff --git a/driver-core/convert-to-api-without-20-char-limit.patch b/driver-core/convert-to-api-without-20-char-limit.patch index 2993c9afe89b43..90134c22ee24bd 100644 --- a/driver-core/convert-to-api-without-20-char-limit.patch +++ b/driver-core/convert-to-api-without-20-char-limit.patch @@ -9,8 +9,49 @@ Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- + arch/x86/kernel/pci-dma.c | 2 +- + drivers/acpi/scan.c | 2 +- + drivers/base/attribute_container.c | 2 +- + drivers/base/firmware_class.c | 8 +------- + drivers/base/isa.c | 4 ++-- + drivers/base/platform.c | 7 +++---- + drivers/char/drm/drm_sysfs.c | 3 +-- + drivers/firewire/fw-device.c | 7 +++---- + drivers/firmware/dmi-id.c | 2 +- + drivers/i2c/i2c-core.c | 6 +++--- + drivers/ide/ide-probe.c | 4 ++-- + drivers/infiniband/core/sysfs.c | 2 +- + drivers/infiniband/core/ucm.c | 3 +-- + drivers/infiniband/ulp/srp/ib_srp.c | 3 +-- + drivers/input/evdev.c | 2 +- + drivers/input/gameport/gameport.c | 2 +- + drivers/input/input.c | 2 +- + drivers/input/joydev.c | 2 +- + drivers/input/mousedev.c | 3 +-- + drivers/input/serio/serio.c | 2 +- + drivers/memstick/core/memstick.c | 6 ++---- + drivers/misc/tifm_core.c | 7 +++---- + drivers/mmc/core/bus.c | 4 ++-- + drivers/mmc/core/host.c | 4 +--- + drivers/mmc/core/sdio_bus.c | 4 +--- drivers/pci/pcie/portdrv_core.c | 4 ++-- drivers/pci/probe.c | 8 ++++---- + drivers/pcmcia/cs.c | 2 +- + drivers/pcmcia/ds.c | 10 +++++----- + drivers/pnp/card.c | 4 ++-- + drivers/pnp/core.c | 6 +++--- + drivers/rtc/class.c | 2 +- + drivers/scsi/hosts.c | 6 ++---- + drivers/scsi/raid_class.c | 3 +-- + drivers/scsi/scsi_debug.c | 4 ++-- + drivers/scsi/scsi_scan.c | 3 +-- + drivers/scsi/scsi_sysfs.c | 12 +++++------- + drivers/scsi/scsi_transport_fc.c | 4 ++-- + drivers/scsi/scsi_transport_iscsi.c | 8 +++----- + drivers/scsi/scsi_transport_sas.c | 14 +++++++------- + drivers/scsi/scsi_transport_srp.c | 2 +- + drivers/scsi/sd.c | 2 +- + drivers/thermal/thermal_sys.c | 4 ++-- drivers/usb/core/endpoint.c | 2 +- drivers/usb/core/message.c | 2 +- drivers/usb/core/usb.c | 5 ++--- @@ -25,11 +66,398 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/usb/gadget/m66592-udc.c | 2 +- drivers/usb/gadget/net2280.c | 2 +- drivers/usb/gadget/omap_udc.c | 2 +- + drivers/usb/gadget/pxa27x_udc.c | 3 +-- drivers/usb/gadget/pxa2xx_udc.c | 2 +- drivers/usb/gadget/s3c2410_udc.c | 2 +- + drivers/usb/host/isp1760-hcd.c | 2 +- + drivers/usb/host/isp1760-if.c | 6 +++--- drivers/usb/serial/usb-serial.c | 2 +- - 19 files changed, 25 insertions(+), 26 deletions(-) + drivers/video/backlight/backlight.c | 2 +- + drivers/video/backlight/lcd.c | 2 +- + drivers/video/output.c | 2 +- + fs/partitions/check.c | 12 ++++++------ + net/atm/atm_sysfs.c | 2 +- + net/core/net-sysfs.c | 3 +-- + net/rfkill/rfkill.c | 4 ++-- + net/wireless/core.c | 3 +-- + sound/pci/ac97/ac97_codec.c | 2 +- + 72 files changed, 121 insertions(+), 152 deletions(-) +--- a/arch/x86/kernel/pci-dma.c ++++ b/arch/x86/kernel/pci-dma.c +@@ -42,7 +42,7 @@ EXPORT_SYMBOL(bad_dma_address); + be probably a smaller DMA mask, but this is bug-to-bug compatible + to older i386. */ + struct device fallback_dev = { +- .bus_id = "fallback device", ++ .init_name = "fallback device", + .coherent_dma_mask = DMA_32BIT_MASK, + .dma_mask = &fallback_dev.coherent_dma_mask, + }; +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -441,7 +441,7 @@ static int acpi_device_register(struct a + acpi_device_bus_id->instance_no = 0; + list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); + } +- sprintf(device->dev.bus_id, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); ++ dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); + + if (device->parent) { + list_add_tail(&device->node, &device->parent->children); +--- a/drivers/base/attribute_container.c ++++ b/drivers/base/attribute_container.c +@@ -167,7 +167,7 @@ attribute_container_add_device(struct de + ic->classdev.parent = get_device(dev); + ic->classdev.class = cont->class; + cont->class->dev_release = attribute_container_release; +- strcpy(ic->classdev.bus_id, dev_name(dev)); ++ dev_set_name(&ic->classdev, dev_name(dev)); + if (fn) + fn(cont, dev, &ic->classdev); + else +--- a/drivers/base/firmware_class.c ++++ b/drivers/base/firmware_class.c +@@ -290,12 +290,6 @@ firmware_class_timeout(u_long data) + fw_load_abort(fw_priv); + } + +-static inline void fw_setup_device_id(struct device *f_dev, struct device *dev) +-{ +- /* XXX warning we should watch out for name collisions */ +- strlcpy(f_dev->bus_id, dev_name(dev), BUS_ID_SIZE); +-} +- + static int fw_register_device(struct device **dev_p, const char *fw_name, + struct device *device) + { +@@ -320,7 +314,7 @@ static int fw_register_device(struct dev + fw_priv->timeout.data = (u_long) fw_priv; + init_timer(&fw_priv->timeout); + +- fw_setup_device_id(f_dev, device); ++ dev_set_name(f_dev, dev_name(device)); + f_dev->parent = device; + f_dev->class = &firmware_class; + dev_set_drvdata(f_dev, fw_priv); +--- a/drivers/base/isa.c ++++ b/drivers/base/isa.c +@@ -10,7 +10,7 @@ + #include <linux/isa.h> + + static struct device isa_bus = { +- .bus_id = "isa" ++ .init_name = "isa" + }; + + struct isa_dev { +@@ -134,7 +134,7 @@ int isa_register_driver(struct isa_drive + isa_dev->dev.parent = &isa_bus; + isa_dev->dev.bus = &isa_bus_type; + +- snprintf(isa_dev->dev.bus_id, BUS_ID_SIZE, "%s.%u", ++ dev_set_name(&isa_dev->dev, "%s.%u", + isa_driver->driver.name, id); + + isa_dev->dev.platform_data = isa_driver; +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -24,7 +24,7 @@ + driver)) + + struct device platform_bus = { +- .bus_id = "platform", ++ .init_name = "platform", + }; + EXPORT_SYMBOL_GPL(platform_bus); + +@@ -246,10 +246,9 @@ int platform_device_add(struct platform_ + pdev->dev.bus = &platform_bus_type; + + if (pdev->id != -1) +- snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%d", pdev->name, +- pdev->id); ++ dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); + else +- strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE); ++ dev_set_name(&pdev->dev, pdev->name); + + for (i = 0; i < pdev->num_resources; i++) { + struct resource *p, *r = &pdev->resource[i]; +--- a/drivers/char/drm/drm_sysfs.c ++++ b/drivers/char/drm/drm_sysfs.c +@@ -167,8 +167,7 @@ int drm_sysfs_device_add(struct drm_mino + minor->kdev.devt = minor->device; + minor_str = "card%d"; + +- snprintf(minor->kdev.bus_id, BUS_ID_SIZE, minor_str, minor->index); +- ++ dev_set_name(&minor->kdev, minor_str, minor->index); + err = device_register(&minor->kdev); + if (err) { + DRM_ERROR("device add failed: %d\n", err); +--- a/drivers/firewire/fw-device.c ++++ b/drivers/firewire/fw-device.c +@@ -612,8 +612,8 @@ static void create_units(struct fw_devic + unit->device.bus = &fw_bus_type; + unit->device.type = &fw_unit_type; + unit->device.parent = &device->device; +- snprintf(unit->device.bus_id, sizeof(unit->device.bus_id), +- "%s.%d", dev_name(&device->device), i++); ++ dev_set_name(&unit->device, "%s.%d", ++ dev_name(&device->device), i++); + + init_fw_attribute_group(&unit->device, + fw_unit_attributes, +@@ -736,8 +736,7 @@ static void fw_device_init(struct work_s + device->device.type = &fw_device_type; + device->device.parent = device->card->device; + device->device.devt = MKDEV(fw_cdev_major, minor); +- snprintf(device->device.bus_id, sizeof(device->device.bus_id), +- "fw%d", minor); ++ dev_set_name(&device->device, "fw%d", minor); + + init_fw_attribute_group(&device->device, + fw_device_attributes, +--- a/drivers/firmware/dmi-id.c ++++ b/drivers/firmware/dmi-id.c +@@ -223,7 +223,7 @@ static int __init dmi_id_init(void) + } + + dmi_dev->class = &dmi_class; +- strcpy(dmi_dev->bus_id, "id"); ++ dev_set_name(dmi_dev, "id"); + dmi_dev->groups = sys_dmi_attribute_groups; + + ret = device_register(dmi_dev); +--- a/drivers/i2c/i2c-core.c ++++ b/drivers/i2c/i2c-core.c +@@ -452,7 +452,7 @@ static int i2c_register_adapter(struct i + pr_debug("I2C adapter driver [%s] forgot to specify " + "physical device\n", adap->name); + } +- sprintf(adap->dev.bus_id, "i2c-%d", adap->nr); ++ dev_set_name(&adap->dev, "i2c-%d", adap->nr); + adap->dev.release = &i2c_adapter_dev_release; + adap->dev.class = &i2c_adapter_class; + res = device_register(&adap->dev); +@@ -802,8 +802,8 @@ int i2c_attach_client(struct i2c_client + } else + client->dev.release = i2c_client_dev_release; + +- snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id), +- "%d-%04x", i2c_adapter_id(adapter), client->addr); ++ dev_set_name(&client->dev, "%d-%04x", ++ i2c_adapter_id(adapter), client->addr); + res = device_register(&client->dev); + if (res) + goto out_err; +--- a/drivers/ide/ide-probe.c ++++ b/drivers/ide/ide-probe.c +@@ -629,7 +629,7 @@ static int ide_register_port(ide_hwif_t + int ret; + + /* register with global device tree */ +- strlcpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE); ++ dev_set_name(&hwif->gendev, hwif->name); + hwif->gendev.driver_data = hwif; + if (hwif->gendev.parent == NULL) { + if (hwif->dev) +@@ -1298,7 +1298,7 @@ static void hwif_register_devices(ide_hw + + ide_add_generic_settings(drive); + +- snprintf(dev->bus_id, BUS_ID_SIZE, "%u.%u", hwif->index, i); ++ dev_set_name(dev, "%u.%u", hwif->index, i); + dev->parent = &hwif->gendev; + dev->bus = &ide_bus_type; + dev->driver_data = drive; +--- a/drivers/infiniband/core/sysfs.c ++++ b/drivers/infiniband/core/sysfs.c +@@ -674,7 +674,7 @@ int ib_device_register_sysfs(struct ib_d + class_dev->class = &ib_class; + class_dev->driver_data = device; + class_dev->parent = device->dma_device; +- strlcpy(class_dev->bus_id, device->name, BUS_ID_SIZE); ++ dev_set_name(class_dev, device->name); + + INIT_LIST_HEAD(&device->port_list); + +--- a/drivers/infiniband/core/ucm.c ++++ b/drivers/infiniband/core/ucm.c +@@ -1260,8 +1260,7 @@ static void ib_ucm_add_one(struct ib_dev + ucm_dev->dev.parent = device->dma_device; + ucm_dev->dev.devt = ucm_dev->cdev.dev; + ucm_dev->dev.release = ib_ucm_release_dev; +- snprintf(ucm_dev->dev.bus_id, BUS_ID_SIZE, "ucm%d", +- ucm_dev->devnum); ++ dev_set_name(&ucm_dev->dev, "ucm%d", ucm_dev->devnum); + if (device_register(&ucm_dev->dev)) + goto err_cdev; + +--- a/drivers/infiniband/ulp/srp/ib_srp.c ++++ b/drivers/infiniband/ulp/srp/ib_srp.c +@@ -1977,8 +1977,7 @@ static struct srp_host *srp_add_port(str + + host->dev.class = &srp_class; + host->dev.parent = device->dev->dma_device; +- snprintf(host->dev.bus_id, BUS_ID_SIZE, "srp-%s-%d", +- device->dev->name, port); ++ dev_set_name(&host->dev, "srp-%s-%d", device->dev->name, port); + + if (device_register(&host->dev)) + goto free_host; +--- a/drivers/input/evdev.c ++++ b/drivers/input/evdev.c +@@ -899,7 +899,7 @@ static int evdev_connect(struct input_ha + evdev->handle.handler = handler; + evdev->handle.private = evdev; + +- strlcpy(evdev->dev.bus_id, evdev->name, sizeof(evdev->dev.bus_id)); ++ dev_set_name(&evdev->dev, evdev->name); + evdev->dev.devt = MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor); + evdev->dev.class = &input_class; + evdev->dev.parent = &dev->dev; +--- a/drivers/input/gameport/gameport.c ++++ b/drivers/input/gameport/gameport.c +@@ -529,7 +529,7 @@ static void gameport_init_port(struct ga + + mutex_init(&gameport->drv_mutex); + device_initialize(&gameport->dev); +- snprintf(gameport->dev.bus_id, sizeof(gameport->dev.bus_id), ++ dev_set_name(&gameport->dev, + "gameport%lu", (unsigned long)atomic_inc_return(&gameport_no) - 1); + gameport->dev.bus = &gameport_bus; + gameport->dev.release = gameport_release_port; +--- a/drivers/input/input.c ++++ b/drivers/input/input.c +@@ -1388,7 +1388,7 @@ int input_register_device(struct input_d + if (!dev->setkeycode) + dev->setkeycode = input_default_setkeycode; + +- snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), ++ dev_set_name(&dev->dev, + "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1); + + error = device_add(&dev->dev); +--- a/drivers/input/joydev.c ++++ b/drivers/input/joydev.c +@@ -801,7 +801,7 @@ static int joydev_connect(struct input_h + } + } + +- strlcpy(joydev->dev.bus_id, joydev->name, sizeof(joydev->dev.bus_id)); ++ dev_set_name(&joydev->dev, joydev->name); + joydev->dev.devt = MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor); + joydev->dev.class = &input_class; + joydev->dev.parent = &dev->dev; +--- a/drivers/input/mousedev.c ++++ b/drivers/input/mousedev.c +@@ -871,8 +871,7 @@ static struct mousedev *mousedev_create( + mousedev->handle.handler = handler; + mousedev->handle.private = mousedev; + +- strlcpy(mousedev->dev.bus_id, mousedev->name, +- sizeof(mousedev->dev.bus_id)); ++ dev_set_name(&mousedev->dev, mousedev->name); + mousedev->dev.class = &input_class; + if (dev) + mousedev->dev.parent = &dev->dev; +--- a/drivers/input/serio/serio.c ++++ b/drivers/input/serio/serio.c +@@ -539,7 +539,7 @@ static void serio_init_port(struct serio + spin_lock_init(&serio->lock); + mutex_init(&serio->drv_mutex); + device_initialize(&serio->dev); +- snprintf(serio->dev.bus_id, sizeof(serio->dev.bus_id), ++ dev_set_name(&serio->dev, + "serio%ld", (long)atomic_inc_return(&serio_no) - 1); + serio->dev.bus = &serio_bus; + serio->dev.release = serio_release_port; +--- a/drivers/memstick/core/memstick.c ++++ b/drivers/memstick/core/memstick.c +@@ -382,8 +382,7 @@ static struct memstick_dev *memstick_all + + if (card) { + card->host = host; +- snprintf(card->dev.bus_id, sizeof(card->dev.bus_id), +- "%s", dev_name(&host->dev)); ++ dev_set_name(&card->dev, "%s", dev_name(&host->dev)); + card->dev.parent = &host->dev; + card->dev.bus = &memstick_bus_type; + card->dev.release = memstick_free_card; +@@ -507,8 +506,7 @@ int memstick_add_host(struct memstick_ho + if (rc) + return rc; + +- snprintf(host->dev.bus_id, BUS_ID_SIZE, "memstick%u", host->id); +- ++ dev_set_name(&host->dev, "memstick%u", host->id); + rc = device_add(&host->dev); + if (rc) { + spin_lock(&memstick_host_lock); +--- a/drivers/misc/tifm_core.c ++++ b/drivers/misc/tifm_core.c +@@ -203,7 +203,7 @@ int tifm_add_adapter(struct tifm_adapter + if (rc) + return rc; + +- snprintf(fm->dev.bus_id, BUS_ID_SIZE, "tifm%u", fm->id); ++ dev_set_name(&fm->dev, "tifm%u", fm->id); + rc = device_add(&fm->dev); + if (rc) { + spin_lock(&tifm_adapter_lock); +@@ -266,9 +266,8 @@ struct tifm_dev *tifm_alloc_device(struc + sock->dev.dma_mask = fm->dev.parent->dma_mask; + sock->dev.release = tifm_free_device; + +- snprintf(sock->dev.bus_id, BUS_ID_SIZE, +- "tifm_%s%u:%u", tifm_media_type_name(type, 2), +- fm->id, id); ++ dev_set_name(&sock->dev, "tifm_%s%u:%u", ++ tifm_media_type_name(type, 2), fm->id, id); + printk(KERN_INFO DRIVER_NAME + ": %s card detected in socket %u:%u\n", + tifm_media_type_name(type, 0), fm->id, id); +--- a/drivers/mmc/core/bus.c ++++ b/drivers/mmc/core/bus.c +@@ -216,8 +216,8 @@ int mmc_add_card(struct mmc_card *card) + int ret; + const char *type; + +- snprintf(card->dev.bus_id, sizeof(card->dev.bus_id), +- "%s:%04x", mmc_hostname(card->host), card->rca); ++ dev_set_name(&card->dev, "%s:%04x", ++ mmc_hostname(card->host), card->rca); + + switch (card->type) { + case MMC_TYPE_MMC: +--- a/drivers/mmc/core/host.c ++++ b/drivers/mmc/core/host.c +@@ -73,9 +73,7 @@ struct mmc_host *mmc_alloc_host(int extr + if (err) + goto free; + +- snprintf(host->class_dev.bus_id, BUS_ID_SIZE, +- "mmc%d", host->index); +- ++ dev_set_name(&host->class_dev, "mmc%d", host->index); + host->parent = dev; + host->class_dev.parent = dev; + host->class_dev.class = &mmc_host_class; +--- a/drivers/mmc/core/sdio_bus.c ++++ b/drivers/mmc/core/sdio_bus.c +@@ -239,9 +239,7 @@ int sdio_add_func(struct sdio_func *func + { + int ret; + +- snprintf(func->dev.bus_id, sizeof(func->dev.bus_id), +- "%s:%d", mmc_card_id(func->card), func->num); +- ++ dev_set_name(&func->dev, "%s:%d", mmc_card_id(func->card), func->num); + ret = device_add(&func->dev); + if (ret == 0) + sdio_func_set_present(func); --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -237,8 +237,8 @@ static void pcie_device_init(struct pci_ @@ -63,7 +491,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); -@@ -1125,7 +1125,7 @@ struct pci_bus * pci_create_bus(struct d +@@ -1126,7 +1126,7 @@ struct pci_bus * pci_create_bus(struct d memset(dev, 0, sizeof(*dev)); dev->parent = parent; dev->release = pci_release_bus_bridge_dev; @@ -72,7 +500,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> error = device_register(dev); if (error) goto dev_reg_err; -@@ -1136,7 +1136,7 @@ struct pci_bus * pci_create_bus(struct d +@@ -1137,7 +1137,7 @@ struct pci_bus * pci_create_bus(struct d b->dev.class = &pcibus_class; b->dev.parent = b->bridge; @@ -81,6 +509,331 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> error = device_register(&b->dev); if (error) goto class_dev_reg_err; +--- a/drivers/pcmcia/cs.c ++++ b/drivers/pcmcia/cs.c +@@ -228,7 +228,7 @@ int pcmcia_register_socket(struct pcmcia + /* set proper values in socket->dev */ + dev_set_drvdata(&socket->dev, socket); + socket->dev.class = &pcmcia_socket_class; +- snprintf(socket->dev.bus_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock); ++ dev_set_name(&socket->dev, "pcmcia_socket%u", socket->sock); + + /* base address = 0, map = 0 */ + socket->cis_mem.flags = 0; +--- a/drivers/pcmcia/ds.c ++++ b/drivers/pcmcia/ds.c +@@ -647,7 +647,6 @@ struct pcmcia_device * pcmcia_device_add + { + struct pcmcia_device *p_dev, *tmp_dev; + unsigned long flags; +- int bus_id_len; + + s = pcmcia_get_socket(s); + if (!s) +@@ -675,12 +674,13 @@ struct pcmcia_device * pcmcia_device_add + /* by default don't allow DMA */ + p_dev->dma_mask = DMA_MASK_NONE; + p_dev->dev.dma_mask = &p_dev->dma_mask; +- bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no); +- +- p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL); ++ if (dev_set_name(&p_dev->dev, "%d.%d", ++ p_dev->socket->sock, p_dev->device_no)) ++ goto err_put; ++ p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", ++ dev_name(&p_dev->dev)); + if (!p_dev->devname) + goto err_free; +- sprintf (p_dev->devname, "pcmcia%s", dev_name(&p_dev->dev)); + ds_dbg(3, "devname is %s\n", p_dev->devname); + + spin_lock_irqsave(&pcmcia_dev_list_lock, flags); +--- a/drivers/pnp/card.c ++++ b/drivers/pnp/card.c +@@ -164,7 +164,7 @@ struct pnp_card *pnp_alloc_card(struct p + card->number = id; + + card->dev.parent = &card->protocol->dev; +- sprintf(card->dev.bus_id, "%02x:%02x", card->protocol->number, ++ dev_set_name(&card->dev, "%02x:%02x", card->protocol->number, + card->number); + + dev_id = pnp_add_card_id(card, pnpid); +@@ -291,7 +291,7 @@ int pnp_add_card_device(struct pnp_card + { + dev->dev.parent = &card->dev; + dev->card_link = NULL; +- snprintf(dev->dev.bus_id, BUS_ID_SIZE, "%02x:%02x.%02x", ++ dev_set_name(&dev->dev, "%02x:%02x.%02x", + dev->protocol->number, card->number, dev->number); + spin_lock(&pnp_lock); + dev->card = card; +--- a/drivers/pnp/core.c ++++ b/drivers/pnp/core.c +@@ -70,7 +70,7 @@ int pnp_register_protocol(struct pnp_pro + spin_unlock(&pnp_lock); + + protocol->number = nodenum; +- sprintf(protocol->dev.bus_id, "pnp%d", nodenum); ++ dev_set_name(&protocol->dev, "pnp%d", nodenum); + return device_register(&protocol->dev); + } + +@@ -135,8 +135,8 @@ struct pnp_dev *pnp_alloc_dev(struct pnp + dev->dev.coherent_dma_mask = dev->dma_mask; + dev->dev.release = &pnp_release_device; + +- sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, +- dev->number); ++ dev_set_name(&dev->dev, "%02x:%02x", ++ dev->protocol->number, dev->number); + + dev_id = pnp_add_id(dev, pnpid); + if (!dev_id) { +--- a/drivers/rtc/class.c ++++ b/drivers/rtc/class.c +@@ -152,7 +152,7 @@ struct rtc_device *rtc_device_register(c + init_waitqueue_head(&rtc->irq_queue); + + strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE); +- snprintf(rtc->dev.bus_id, BUS_ID_SIZE, "rtc%d", id); ++ dev_set_name(&rtc->dev, "rtc%d", id); + + rtc_dev_prepare(rtc); + +--- a/drivers/scsi/hosts.c ++++ b/drivers/scsi/hosts.c +@@ -388,8 +388,7 @@ struct Scsi_Host *scsi_host_alloc(struct + shost->dma_boundary = 0xffffffff; + + device_initialize(&shost->shost_gendev); +- snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", +- shost->host_no); ++ dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); + #ifndef CONFIG_SYSFS_DEPRECATED + shost->shost_gendev.bus = &scsi_bus_type; + #endif +@@ -398,8 +397,7 @@ struct Scsi_Host *scsi_host_alloc(struct + device_initialize(&shost->shost_dev); + shost->shost_dev.parent = &shost->shost_gendev; + shost->shost_dev.class = &shost_class; +- snprintf(shost->shost_dev.bus_id, BUS_ID_SIZE, "host%d", +- shost->host_no); ++ dev_set_name(&shost->shost_dev, "host%d", shost->host_no); + shost->shost_dev.groups = scsi_sysfs_shost_attr_groups; + + shost->ehandler = kthread_run(scsi_error_handler, shost, +--- a/drivers/scsi/raid_class.c ++++ b/drivers/scsi/raid_class.c +@@ -237,8 +237,7 @@ int raid_component_add(struct raid_templ + rc->dev.parent = get_device(component_dev); + rc->num = rd->component_count++; + +- snprintf(rc->dev.bus_id, sizeof(rc->dev.bus_id), +- "component-%d", rc->num); ++ dev_set_name(&rc->dev, "component-%d", rc->num); + list_add_tail(&rc->node, &rd->component_list); + rc->dev.class = &raid_class.class; + err = device_add(&rc->dev); +--- a/drivers/scsi/scsi_debug.c ++++ b/drivers/scsi/scsi_debug.c +@@ -2488,7 +2488,7 @@ static void pseudo_0_release(struct devi + } + + static struct device pseudo_primary = { +- .bus_id = "pseudo_0", ++ .init_name = "pseudo_0", + .release = pseudo_0_release, + }; + +@@ -2648,7 +2648,7 @@ static int sdebug_add_adapter(void) + sdbg_host->dev.bus = &pseudo_lld_bus; + sdbg_host->dev.parent = &pseudo_primary; + sdbg_host->dev.release = &sdebug_release_adapter; +- sprintf(sdbg_host->dev.bus_id, "adapter%d", scsi_debug_add_host); ++ dev_set_name(&sdbg_host->dev, "adapter%d", scsi_debug_add_host); + + error = device_register(&sdbg_host->dev); + +--- a/drivers/scsi/scsi_scan.c ++++ b/drivers/scsi/scsi_scan.c +@@ -411,8 +411,7 @@ static struct scsi_target *scsi_alloc_ta + device_initialize(dev); + starget->reap_ref = 1; + dev->parent = get_device(parent); +- sprintf(dev->bus_id, "target%d:%d:%d", +- shost->host_no, channel, id); ++ dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); + #ifndef CONFIG_SYSFS_DEPRECATED + dev->bus = &scsi_bus_type; + #endif +--- a/drivers/scsi/scsi_sysfs.c ++++ b/drivers/scsi/scsi_sysfs.c +@@ -1065,16 +1065,14 @@ void scsi_sysfs_device_initialize(struct + device_initialize(&sdev->sdev_gendev); + sdev->sdev_gendev.bus = &scsi_bus_type; + sdev->sdev_gendev.type = &scsi_dev_type; +- sprintf(sdev->sdev_gendev.bus_id,"%d:%d:%d:%d", +- sdev->host->host_no, sdev->channel, sdev->id, +- sdev->lun); +- ++ dev_set_name(&sdev->sdev_gendev,"%d:%d:%d:%d", ++ sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); ++ + device_initialize(&sdev->sdev_dev); + sdev->sdev_dev.parent = &sdev->sdev_gendev; + sdev->sdev_dev.class = &sdev_class; +- snprintf(sdev->sdev_dev.bus_id, BUS_ID_SIZE, +- "%d:%d:%d:%d", sdev->host->host_no, +- sdev->channel, sdev->id, sdev->lun); ++ dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d", ++ sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); + sdev->scsi_level = starget->scsi_level; + transport_setup_device(&sdev->sdev_gendev); + spin_lock_irqsave(shost->host_lock, flags); +--- a/drivers/scsi/scsi_transport_fc.c ++++ b/drivers/scsi/scsi_transport_fc.c +@@ -2503,7 +2503,7 @@ fc_rport_create(struct Scsi_Host *shost, + device_initialize(dev); /* takes self reference */ + dev->parent = get_device(&shost->shost_gendev); /* parent reference */ + dev->release = fc_rport_dev_release; +- sprintf(dev->bus_id, "rport-%d:%d-%d", ++ dev_set_name(dev, "rport-%d:%d-%d", + shost->host_no, channel, rport->number); + transport_setup_device(dev); + +@@ -3172,7 +3172,7 @@ fc_vport_create(struct Scsi_Host *shost, + device_initialize(dev); /* takes self reference */ + dev->parent = get_device(pdev); /* takes parent reference */ + dev->release = fc_vport_dev_release; +- sprintf(dev->bus_id, "vport-%d:%d-%d", ++ dev_set_name(dev, "vport-%d:%d-%d", + shost->host_no, channel, vport->number); + transport_setup_device(dev); + +--- a/drivers/scsi/scsi_transport_iscsi.c ++++ b/drivers/scsi/scsi_transport_iscsi.c +@@ -517,8 +517,7 @@ int iscsi_add_session(struct iscsi_cls_s + session->sid = atomic_add_return(1, &iscsi_session_nr); + session->target_id = target_id; + +- snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u", +- session->sid); ++ dev_set_name(&session->dev, "session%u", session->sid); + err = device_add(&session->dev); + if (err) { + iscsi_cls_session_printk(KERN_ERR, session, +@@ -695,8 +694,7 @@ iscsi_create_conn(struct iscsi_cls_sessi + if (!get_device(&session->dev)) + goto free_conn; + +- snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u", +- session->sid, cid); ++ dev_set_name(&conn->dev, "connection%d:%u", session->sid, cid); + conn->dev.parent = &session->dev; + conn->dev.release = iscsi_conn_release; + err = device_register(&conn->dev); +@@ -1582,7 +1580,7 @@ iscsi_register_transport(struct iscsi_tr + priv->t.user_scan = iscsi_user_scan; + + priv->dev.class = &iscsi_transport_class; +- snprintf(priv->dev.bus_id, BUS_ID_SIZE, "%s", tt->name); ++ dev_set_name(&priv->dev, "%s", tt->name); + err = device_register(&priv->dev); + if (err) + goto free_priv; +--- a/drivers/scsi/scsi_transport_sas.c ++++ b/drivers/scsi/scsi_transport_sas.c +@@ -629,10 +629,10 @@ struct sas_phy *sas_phy_alloc(struct dev + INIT_LIST_HEAD(&phy->port_siblings); + if (scsi_is_sas_expander_device(parent)) { + struct sas_rphy *rphy = dev_to_rphy(parent); +- sprintf(phy->dev.bus_id, "phy-%d:%d:%d", shost->host_no, ++ dev_set_name(&phy->dev, "phy-%d:%d:%d", shost->host_no, + rphy->scsi_target_id, number); + } else +- sprintf(phy->dev.bus_id, "phy-%d:%d", shost->host_no, number); ++ dev_set_name(&phy->dev, "phy-%d:%d", shost->host_no, number); + + transport_setup_device(&phy->dev); + +@@ -821,10 +821,10 @@ struct sas_port *sas_port_alloc(struct d + + if (scsi_is_sas_expander_device(parent)) { + struct sas_rphy *rphy = dev_to_rphy(parent); +- sprintf(port->dev.bus_id, "port-%d:%d:%d", shost->host_no, ++ dev_set_name(&port->dev, "port-%d:%d:%d", shost->host_no, + rphy->scsi_target_id, port->port_identifier); + } else +- sprintf(port->dev.bus_id, "port-%d:%d", shost->host_no, ++ dev_set_name(&port->dev, "port-%d:%d", shost->host_no, + port->port_identifier); + + transport_setup_device(&port->dev); +@@ -1369,10 +1369,10 @@ struct sas_rphy *sas_end_device_alloc(st + rdev->rphy.dev.release = sas_end_device_release; + if (scsi_is_sas_expander_device(parent->dev.parent)) { + struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent); +- sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d:%d", ++ dev_set_name(&rdev->rphy.dev, "end_device-%d:%d:%d", + shost->host_no, rphy->scsi_target_id, parent->port_identifier); + } else +- sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d", ++ dev_set_name(&rdev->rphy.dev, "end_device-%d:%d", + shost->host_no, parent->port_identifier); + rdev->rphy.identify.device_type = SAS_END_DEVICE; + sas_rphy_initialize(&rdev->rphy); +@@ -1413,7 +1413,7 @@ struct sas_rphy *sas_expander_alloc(stru + mutex_lock(&sas_host->lock); + rdev->rphy.scsi_target_id = sas_host->next_expander_id++; + mutex_unlock(&sas_host->lock); +- sprintf(rdev->rphy.dev.bus_id, "expander-%d:%d", ++ dev_set_name(&rdev->rphy.dev, "expander-%d:%d", + shost->host_no, rdev->rphy.scsi_target_id); + rdev->rphy.identify.device_type = type; + sas_rphy_initialize(&rdev->rphy); +--- a/drivers/scsi/scsi_transport_srp.c ++++ b/drivers/scsi/scsi_transport_srp.c +@@ -212,7 +212,7 @@ struct srp_rport *srp_rport_add(struct S + rport->roles = ids->roles; + + id = atomic_inc_return(&to_srp_host_attrs(shost)->next_port_id); +- sprintf(rport->dev.bus_id, "port-%d:%d", shost->host_no, id); ++ dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id); + + transport_setup_device(&rport->dev); + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -1675,7 +1675,7 @@ static int sd_probe(struct device *dev) + device_initialize(&sdkp->dev); + sdkp->dev.parent = &sdp->sdev_gendev; + sdkp->dev.class = &sd_disk_class; +- strncpy(sdkp->dev.bus_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE); ++ dev_set_name(&sdkp->dev, dev_name(&sdp->sdev_gendev)); + + if (device_add(&sdkp->dev)) + goto out_put; +--- a/drivers/thermal/thermal_sys.c ++++ b/drivers/thermal/thermal_sys.c +@@ -630,7 +630,7 @@ struct thermal_cooling_device *thermal_c + cdev->ops = ops; + cdev->device.class = &thermal_class; + cdev->devdata = devdata; +- sprintf(cdev->device.bus_id, "cooling_device%d", cdev->id); ++ dev_set_name(&cdev->device, "cooling_device%d", cdev->id); + result = device_register(&cdev->device); + if (result) { + release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); +@@ -769,7 +769,7 @@ struct thermal_zone_device *thermal_zone + tz->device.class = &thermal_class; + tz->devdata = devdata; + tz->trips = trips; +- sprintf(tz->device.bus_id, "thermal_zone%d", tz->id); ++ dev_set_name(&tz->device, "thermal_zone%d", tz->id); + result = device_register(&tz->device); + if (result) { + release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -302,7 +302,7 @@ int usb_create_ep_files(struct device *p @@ -247,6 +1000,25 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> udc->gadget.dev.release = omap_udc_release; udc->gadget.dev.parent = &odev->dev; if (use_dma) +--- a/drivers/usb/gadget/pxa27x_udc.c ++++ b/drivers/usb/gadget/pxa27x_udc.c +@@ -1546,7 +1546,6 @@ static __init void udc_init_data(struct + INIT_LIST_HEAD(&dev->gadget.ep0->ep_list); + dev->udc_usb_ep[0].pxa_ep = &dev->pxa_ep[0]; + ep0_idle(dev); +- strcpy(dev->dev->bus_id, ""); + + /* PXA endpoints init */ + for (i = 0; i < NR_PXA_ENDPOINTS; i++) { +@@ -2167,7 +2166,7 @@ static struct pxa_udc memory = { + .ep0 = &memory.udc_usb_ep[0].usb_ep, + .name = driver_name, + .dev = { +- .bus_id = "gadget", ++ .init_name = "gadget", + }, + }, + --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c @@ -1826,7 +1826,7 @@ static struct pxa2xx_udc memory = { @@ -269,6 +1041,46 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> }, }, +--- a/drivers/usb/host/isp1760-hcd.c ++++ b/drivers/usb/host/isp1760-hcd.c +@@ -2195,7 +2195,7 @@ struct usb_hcd *isp1760_register(u64 res + /* prevent usb-core allocating DMA pages */ + dev->dma_mask = NULL; + +- hcd = usb_create_hcd(&isp1760_hc_driver, dev, dev->bus_id); ++ hcd = usb_create_hcd(&isp1760_hc_driver, dev, dev_name(dev)); + if (!hcd) + return ERR_PTR(-ENOMEM); + +--- a/drivers/usb/host/isp1760-if.c ++++ b/drivers/usb/host/isp1760-if.c +@@ -41,7 +41,7 @@ static int of_isp1760_probe(struct of_de + return -ENXIO; + + res = request_mem_region(memory.start, memory.end - memory.start + 1, +- dev->dev.bus_id); ++ dev_name(&dev->dev)); + if (!res) + return -EBUSY; + +@@ -56,7 +56,7 @@ static int of_isp1760_probe(struct of_de + oirq.size); + + hcd = isp1760_register(memory.start, res_len, virq, +- IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id); ++ IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev)); + if (IS_ERR(hcd)) { + ret = PTR_ERR(hcd); + goto release_reg; +@@ -200,7 +200,7 @@ static int __devinit isp1761_pci_probe(s + + dev->dev.dma_mask = NULL; + hcd = isp1760_register(pci_mem_phy0, length, dev->irq, +- IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id); ++ IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev)); + pci_set_drvdata(dev, hcd); + if (!hcd) + return 0; --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -938,7 +938,7 @@ int usb_serial_probe(struct usb_interfac @@ -280,3 +1092,134 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> dbg ("%s - registering %s", __func__, dev_name(&port->dev)); retval = device_register(&port->dev); if (retval) +--- a/drivers/video/backlight/backlight.c ++++ b/drivers/video/backlight/backlight.c +@@ -216,7 +216,7 @@ struct backlight_device *backlight_devic + new_bd->dev.class = backlight_class; + new_bd->dev.parent = parent; + new_bd->dev.release = bl_device_release; +- strlcpy(new_bd->dev.bus_id, name, BUS_ID_SIZE); ++ dev_set_name(&new_bd->dev, name); + dev_set_drvdata(&new_bd->dev, devdata); + + rc = device_register(&new_bd->dev); +--- a/drivers/video/backlight/lcd.c ++++ b/drivers/video/backlight/lcd.c +@@ -193,7 +193,7 @@ struct lcd_device *lcd_device_register(c + new_ld->dev.class = lcd_class; + new_ld->dev.parent = parent; + new_ld->dev.release = lcd_device_release; +- strlcpy(new_ld->dev.bus_id, name, BUS_ID_SIZE); ++ dev_set_name(&new_ld->dev, name); + dev_set_drvdata(&new_ld->dev, devdata); + + rc = device_register(&new_ld->dev); +--- a/drivers/video/output.c ++++ b/drivers/video/output.c +@@ -96,7 +96,7 @@ struct output_device *video_output_regis + new_dev->props = op; + new_dev->dev.class = &video_output_class; + new_dev->dev.parent = dev; +- strlcpy(new_dev->dev.bus_id,name, BUS_ID_SIZE); ++ dev_set_name(&new_dev->dev, name); + dev_set_drvdata(&new_dev->dev, devdata); + ret_code = device_register(&new_dev->dev); + if (ret_code) { +--- a/fs/partitions/check.c ++++ b/fs/partitions/check.c +@@ -363,11 +363,9 @@ void add_partition(struct gendisk *disk, + p->policy = disk->policy; + + if (isdigit(dev_name(&disk->dev)[strlen(dev_name(&disk->dev))-1])) +- snprintf(p->dev.bus_id, BUS_ID_SIZE, +- "%sp%d", dev_name(&disk->dev), part); ++ dev_set_name(&p->dev, "%sp%d", dev_name(&disk->dev), part); + else +- snprintf(p->dev.bus_id, BUS_ID_SIZE, +- "%s%d", dev_name(&disk->dev), part); ++ dev_set_name(&p->dev, "%s%d", dev_name(&disk->dev), part); + + device_initialize(&p->dev); + p->dev.devt = MKDEV(disk->major, disk->first_minor + part); +@@ -393,6 +391,7 @@ void add_partition(struct gendisk *disk, + void register_disk(struct gendisk *disk) + { + struct block_device *bdev; ++ char name[32]; + char *s; + int i; + struct hd_struct *p; +@@ -401,11 +400,12 @@ void register_disk(struct gendisk *disk) + disk->dev.parent = disk->driverfs_dev; + disk->dev.devt = MKDEV(disk->major, disk->first_minor); + +- strlcpy(disk->dev.bus_id, disk->disk_name, BUS_ID_SIZE); ++ strlcpy(name, disk->disk_name, sizeof(name)); + /* ewww... some of these buggers have / in the name... */ +- s = strchr(disk->dev.bus_id, '/'); ++ s = strchr(name, '/'); + if (s) + *s = '!'; ++ dev_set_name(&disk->dev, name); + + /* delay uevents, until we scanned partition table */ + disk->dev.uevent_suppress = 1; +--- a/net/atm/atm_sysfs.c ++++ b/net/atm/atm_sysfs.c +@@ -149,7 +149,7 @@ int atm_register_sysfs(struct atm_dev *a + cdev->class = &atm_class; + dev_set_drvdata(cdev, adev); + +- snprintf(cdev->bus_id, BUS_ID_SIZE, "%s%d", adev->type, adev->number); ++ dev_set_name(cdev, "%s%d", adev->type, adev->number); + err = device_register(cdev); + if (err < 0) + return err; +--- a/net/core/net-sysfs.c ++++ b/net/core/net-sysfs.c +@@ -453,8 +453,7 @@ int netdev_register_kobject(struct net_d + dev->platform_data = net; + dev->groups = groups; + +- BUILD_BUG_ON(BUS_ID_SIZE < IFNAMSIZ); +- strlcpy(dev->bus_id, net->name, BUS_ID_SIZE); ++ dev_set_name(dev, net->name); + + #ifdef CONFIG_SYSFS + if (net->get_stats) +--- a/net/rfkill/rfkill.c ++++ b/net/rfkill/rfkill.c +@@ -389,8 +389,8 @@ int rfkill_register(struct rfkill *rfkil + if (rfkill->type >= RFKILL_TYPE_MAX) + return -EINVAL; + +- snprintf(dev->bus_id, sizeof(dev->bus_id), +- "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1); ++ dev_set_name(dev, "rfkill%ld", ++ (long)atomic_inc_return(&rfkill_no) - 1); + + rfkill_led_trigger_register(rfkill); + +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -213,8 +213,7 @@ struct wiphy *wiphy_new(struct cfg80211_ + } + + /* give it a proper name */ +- snprintf(drv->wiphy.dev.bus_id, BUS_ID_SIZE, +- PHY_NAME "%d", drv->idx); ++ dev_set_name(&drv->wiphy.dev, PHY_NAME "%d", drv->idx); + + mutex_init(&drv->mtx); + mutex_init(&drv->devlist_mtx); +--- a/sound/pci/ac97/ac97_codec.c ++++ b/sound/pci/ac97/ac97_codec.c +@@ -1924,7 +1924,7 @@ static int snd_ac97_dev_register(struct + ac97->dev.bus = &ac97_bus_type; + ac97->dev.parent = ac97->bus->card->dev; + ac97->dev.release = ac97_device_release; +- snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s", ++ dev_set_name(&ac97->dev, "%d-%d:%s", + ac97->bus->card->number, ac97->num, + snd_ac97_get_short_name(ac97)); + if ((err = device_register(&ac97->dev)) < 0) { diff --git a/driver-core/driver-core-fix-a-lot-of-printk-usages-of-bus_id.patch b/driver-core/driver-core-fix-a-lot-of-printk-usages-of-bus_id.patch index 12ee93c39089a5..7d82001981000d 100644 --- a/driver-core/driver-core-fix-a-lot-of-printk-usages-of-bus_id.patch +++ b/driver-core/driver-core-fix-a-lot-of-printk-usages-of-bus_id.patch @@ -239,7 +239,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> result = device_add(&device->dev); if(result) { - printk(KERN_ERR PREFIX "Error adding device %s", device->dev.bus_id); -+ dev_err("Error adding device\n"); ++ dev_err(&device->dev, "Error adding device\n"); goto end; } diff --git a/driver-core/put_device-might_sleep.patch b/driver-core/put_device-might_sleep.patch index d8f9a529f6e5b0..04525234ee6b7c 100644 --- a/driver-core/put_device-might_sleep.patch +++ b/driver-core/put_device-might_sleep.patch @@ -12,7 +12,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -467,6 +467,7 @@ EXPORT_SYMBOL_GPL(device_create_bin_file +@@ -470,6 +470,7 @@ EXPORT_SYMBOL_GPL(device_create_bin_file */ void device_remove_bin_file(struct device *dev, struct bin_attribute *attr) { diff --git a/driver-core/read-dev_name-instead-of-bus_id.patch b/driver-core/read-dev_name-instead-of-bus_id.patch index 5cc1ebee678fbf..0d88a8b5781b40 100644 --- a/driver-core/read-dev_name-instead-of-bus_id.patch +++ b/driver-core/read-dev_name-instead-of-bus_id.patch @@ -45,15 +45,14 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/base/power/main.c | 2 drivers/base/power/trace.c | 4 drivers/edac/cell_edac.c | 2 - drivers/edac/edac_core.h | 2 - drivers/edac/edac_device.c | 6 - drivers/edac/edac_mc.c | 8 - drivers/edac/edac_pci.c | 6 + drivers/edac/edac_device.c | 2 + drivers/edac/edac_mc.c | 2 + drivers/edac/edac_pci.c | 2 drivers/edac/edac_pci_sysfs.c | 6 drivers/edac/mpc85xx_edac.c | 2 drivers/edac/mv64x60_edac.c | 8 drivers/eisa/eisa-bus.c | 2 - drivers/firewire/fw-device.c | 8 + drivers/firewire/fw-device.c | 11 - drivers/firewire/fw-ohci.c | 2 drivers/firewire/fw-sbp2.c | 2 drivers/hwmon/hwmon.c | 2 @@ -64,7 +63,10 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/ide/ide-acpi.c | 2 drivers/ieee1394/nodemgr.c | 6 drivers/input/gameport/ns558.c | 2 + drivers/input/serio/ambakmi.c | 4 drivers/input/serio/gscps2.c | 2 + drivers/input/serio/pcips2.c | 2 + drivers/input/serio/sa1111ps2.c | 4 drivers/input/touchscreen/ads7846.c | 4 drivers/lguest/lguest_device.c | 2 drivers/macintosh/macio_asic.c | 8 @@ -187,7 +189,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/scsi/scsi_scan.c | 4 drivers/scsi/scsi_transport_fc.c | 10 - drivers/scsi/scsi_transport_sas.c | 18 +- - drivers/scsi/sd.c | 2 drivers/scsi/ses.c | 2 drivers/scsi/sim710.c | 5 drivers/scsi/sni_53c710.c | 2 @@ -270,7 +271,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> sound/isa/gus/gusclassic.c | 8 sound/isa/gus/gusextreme.c | 14 - sound/isa/sb/sb8.c | 4 - 257 files changed, 751 insertions(+), 741 deletions(-) + 258 files changed, 749 insertions(+), 738 deletions(-) --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c @@ -1008,106 +1009,39 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> mci->edac_check = cell_edac_check; cell_edac_init_csrows(mci); ---- a/drivers/edac/edac_core.h -+++ b/drivers/edac/edac_core.h -@@ -97,7 +97,7 @@ extern int edac_debug_level; - #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ - PCI_DEVICE_ID_ ## vend ## _ ## dev - --#define dev_name(dev) (dev)->dev_name -+#define edev_name(edev) (edev)->dev_name - - /* memory devices */ - enum dev_type { --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -333,7 +333,7 @@ static int add_edac_dev_to_global_list(s fail0: edac_printk(KERN_WARNING, EDAC_MC, "%s (%s) %s %s already assigned %d\n", -- rover->dev->bus_id, dev_name(rover), -+ dev_name(rover->dev), edev_name(rover), +- rover->dev->bus_id, edac_dev_name(rover), ++ dev_name(rover->dev), edac_dev_name(rover), rover->mod_name, rover->ctl_name, rover->dev_idx); return 1; -@@ -538,7 +538,7 @@ int edac_device_add_device(struct edac_d - "'%s': DEV '%s' (%s)\n", - edac_dev->mod_name, - edac_dev->ctl_name, -- dev_name(edac_dev), -+ edev_name(edac_dev), - edac_op_state_to_string(edac_dev->op_state)); - - mutex_unlock(&device_ctls_mutex); -@@ -599,7 +599,7 @@ struct edac_device_ctl_info *edac_device - edac_printk(KERN_INFO, EDAC_MC, - "Removed device %d for %s %s: DEV %s\n", - edac_dev->dev_idx, -- edac_dev->mod_name, edac_dev->ctl_name, dev_name(edac_dev)); -+ edac_dev->mod_name, edac_dev->ctl_name, edev_name(edac_dev)); - - return edac_dev; - } --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c -@@ -401,8 +401,8 @@ static int add_mc_to_global_list(struct +@@ -401,7 +401,7 @@ static int add_mc_to_global_list(struct fail0: edac_printk(KERN_WARNING, EDAC_MC, - "%s (%s) %s %s already assigned %d\n", p->dev->bus_id, -- dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx); + "%s (%s) %s %s already assigned %d\n", dev_name(p->dev), -+ edev_name(mci), p->mod_name, p->ctl_name, p->mc_idx); + edac_dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx); return 1; - fail1: -@@ -517,7 +517,7 @@ int edac_mc_add_mc(struct mem_ctl_info * - - /* Report action taken */ - edac_mc_printk(mci, KERN_INFO, "Giving out device to '%s' '%s':" -- " DEV %s\n", mci->mod_name, mci->ctl_name, dev_name(mci)); -+ " DEV %s\n", mci->mod_name, mci->ctl_name, edev_name(mci)); - - mutex_unlock(&mem_ctls_mutex); - return 0; -@@ -565,7 +565,7 @@ struct mem_ctl_info *edac_mc_del_mc(stru - - edac_printk(KERN_INFO, EDAC_MC, - "Removed device %d for %s %s: DEV %s\n", mci->mc_idx, -- mci->mod_name, mci->ctl_name, dev_name(mci)); -+ mci->mod_name, mci->ctl_name, edev_name(mci)); - - return mci; - } --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c @@ -150,7 +150,7 @@ static int add_edac_pci_to_global_list(s fail0: edac_printk(KERN_WARNING, EDAC_PCI, "%s (%s) %s %s already assigned %d\n", -- rover->dev->bus_id, dev_name(rover), -+ dev_name(rover->dev), edev_name(rover), +- rover->dev->bus_id, edac_dev_name(rover), ++ dev_name(rover->dev), edac_dev_name(rover), rover->mod_name, rover->ctl_name, rover->pci_idx); return 1; -@@ -360,7 +360,7 @@ int edac_pci_add_device(struct edac_pci_ - " DEV '%s' (%s)\n", - pci->mod_name, - pci->ctl_name, -- dev_name(pci), edac_op_state_to_string(pci->op_state)); -+ edev_name(pci), edac_op_state_to_string(pci->op_state)); - - mutex_unlock(&edac_pci_ctls_mutex); - return 0; -@@ -415,7 +415,7 @@ struct edac_pci_ctl_info *edac_pci_del_d - - edac_printk(KERN_INFO, EDAC_PCI, - "Removed device %d for %s %s: DEV %s\n", -- pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci)); -+ pci->pci_idx, pci->mod_name, pci->ctl_name, edev_name(pci)); - - return pci; - } --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c @@ -557,7 +557,7 @@ static void edac_pci_dev_parity_test(str @@ -1222,7 +1156,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> device->config_rom[3], device->config_rom[4], 1 << device->max_speed); device->config_rom_retries = 0; -@@ -908,7 +908,7 @@ static void fw_device_refresh(struct wor +@@ -908,12 +908,13 @@ static void fw_device_refresh(struct wor FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) goto gone; @@ -1231,6 +1165,13 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> device->config_rom_retries = 0; goto out; + give_up: +- fw_notify("giving up on refresh of device %s\n", device->device.bus_id); ++ fw_notify("giving up on refresh of device %s\n", ++ dev_name(&device->device)); + gone: + atomic_set(&device->state, FW_DEVICE_SHUTDOWN); + fw_device_shutdown(work); --- a/drivers/firewire/fw-ohci.c +++ b/drivers/firewire/fw-ohci.c @@ -2442,7 +2442,7 @@ pci_probe(struct pci_dev *dev, const str @@ -1360,6 +1301,19 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> port->dev.parent = &dev->dev; port->io = ioport; +--- a/drivers/input/serio/ambakmi.c ++++ b/drivers/input/serio/ambakmi.c +@@ -129,8 +129,8 @@ static int amba_kmi_probe(struct amba_de + io->write = amba_kmi_write; + io->open = amba_kmi_open; + io->close = amba_kmi_close; +- strlcpy(io->name, dev->dev.bus_id, sizeof(io->name)); +- strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys)); ++ strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name)); ++ strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys)); + io->port_data = kmi; + io->dev.parent = &dev->dev; + --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -359,7 +359,7 @@ static int __init gscps2_probe(struct pa @@ -1371,6 +1325,30 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> serio->id.type = SERIO_8042; serio->write = gscps2_write; serio->open = gscps2_open; +--- a/drivers/input/serio/pcips2.c ++++ b/drivers/input/serio/pcips2.c +@@ -153,7 +153,7 @@ static int __devinit pcips2_probe(struct + serio->open = pcips2_open; + serio->close = pcips2_close; + strlcpy(serio->name, pci_name(dev), sizeof(serio->name)); +- strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys)); ++ strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); + serio->port_data = ps2if; + serio->dev.parent = &dev->dev; + ps2if->io = serio; +--- a/drivers/input/serio/sa1111ps2.c ++++ b/drivers/input/serio/sa1111ps2.c +@@ -246,8 +246,8 @@ static int __devinit ps2_probe(struct sa + serio->write = ps2_write; + serio->open = ps2_open; + serio->close = ps2_close; +- strlcpy(serio->name, dev->dev.bus_id, sizeof(serio->name)); +- strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys)); ++ strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name)); ++ strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); + serio->port_data = ps2if; + serio->dev.parent = &dev->dev; + ps2if->io = serio; --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -538,7 +538,7 @@ static void ads7846_rx(void *ads) @@ -2056,7 +2034,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> info->res = request_mem_region(dev->resource->start, dev->resource->end - dev->resource->start + 1, - dev->dev.bus_id); -+ dev_name(dev->dev)); ++ dev_name(&dev->dev)); if (!info->res) { dev_err(&dev->dev, "Could not reserve memory region\n"); err = -ENOMEM; @@ -5154,17 +5132,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> mutex_lock(&sas_host->lock); ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -1675,7 +1675,7 @@ static int sd_probe(struct device *dev) - device_initialize(&sdkp->dev); - sdkp->dev.parent = &sdp->sdev_gendev; - sdkp->dev.class = &sd_disk_class; -- strncpy(sdkp->dev.bus_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE); -+ strncpy(sdkp->dev.bus_id, dev_name(&sdp->sdev_gendev), BUS_ID_SIZE); - - if (device_add(&sdkp->dev)) - goto out_put; --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -515,7 +515,7 @@ static int ses_intf_add(struct device *c @@ -6371,7 +6338,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> /* ecc layout structure pointer - read only ! */ --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -975,9 +975,9 @@ static inline void pci_set_drvdata(struc +@@ -976,9 +976,9 @@ static inline void pci_set_drvdata(struc /* If you want to know what to call your pci_dev, ask this function. * Again, it's a wrapper around the generic device. */ diff --git a/driver-core/sysfs-add-sys-dev-char-block-to-lookup-sysfs-path-by-major-minor.patch b/driver-core/sysfs-add-sys-dev-char-block-to-lookup-sysfs-path-by-major-minor.patch index 944e2e383a6589..5a0f11415e98e1 100644 --- a/driver-core/sysfs-add-sys-dev-char-block-to-lookup-sysfs-path-by-major-minor.patch +++ b/driver-core/sysfs-add-sys-dev-char-block-to-lookup-sysfs-path-by-major-minor.patch @@ -50,20 +50,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> include/linux/device.h | 3 + 7 files changed, 124 insertions(+), 2 deletions(-) ---- a/block/genhd.c -+++ b/block/genhd.c -@@ -368,7 +368,10 @@ static struct kobject *base_probe(dev_t - - static int __init genhd_device_init(void) - { -- int error = class_register(&block_class); -+ int error; -+ -+ block_class.dev_kobj = sysfs_dev_block_kobj; -+ error = class_register(&block_class); - if (unlikely(error)) - return error; - bdev_map = kobj_map_init(base_probe, &block_class_lock); --- /dev/null +++ b/Documentation/ABI/testing/sysfs-dev @@ -0,0 +1,20 @@ @@ -109,6 +95,20 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> More information can driver-model specific features can be found in Documentation/driver-model/. +--- a/block/genhd.c ++++ b/block/genhd.c +@@ -368,7 +368,10 @@ static struct kobject *base_probe(dev_t + + static int __init genhd_device_init(void) + { +- int error = class_register(&block_class); ++ int error; ++ ++ block_class.dev_kobj = sysfs_dev_block_kobj; ++ error = class_register(&block_class); + if (unlikely(error)) + return error; + bdev_map = kobj_map_init(base_probe, &block_class_lock); --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -149,6 +149,10 @@ int class_register(struct class *cls) diff --git a/driver-core/sysfs-crash-debugging.patch b/driver-core/sysfs-crash-debugging.patch index 2a63880879b194..b0b51c5f731d68 100644 --- a/driver-core/sysfs-crash-debugging.patch +++ b/driver-core/sysfs-crash-debugging.patch @@ -109,7 +109,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> extern int __must_check sysfs_init(void); -@@ -227,6 +228,10 @@ static inline int __must_check sysfs_ini +@@ -221,6 +222,10 @@ static inline int __must_check sysfs_ini return 0; } diff --git a/driver-core/warn-when-statically-allocated-kobjects-are-used.patch b/driver-core/warn-when-statically-allocated-kobjects-are-used.patch index 3f2a30373e844f..eb904808ccf78f 100644 --- a/driver-core/warn-when-statically-allocated-kobjects-are-used.patch +++ b/driver-core/warn-when-statically-allocated-kobjects-are-used.patch @@ -47,7 +47,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> void setup_arch(char **); --- a/init/main.c +++ b/init/main.c -@@ -788,12 +788,21 @@ static void run_init_process(char *init_ +@@ -789,12 +789,21 @@ static void run_init_process(char *init_ kernel_execve(init_filename, argv_init, envp_init); } @@ -1 +1 @@ -2.6.26-rc1 +2.6.26-rc1-git4 |
