Commit fc3a8828 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

driver core: fix a lot of printk usages of bus_id

We have the dev_printk() variants for this kind of thing, use them
instead of directly trying to access the bus_id field of struct device.

This is done in order to remove bus_id entirely.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b98cb4b7
...@@ -554,9 +554,8 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size, ...@@ -554,9 +554,8 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC); device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
if (!device_info) { if (!device_info) {
printk(KERN_ERR dev_err(dev,
"Could not allocated dmabounce_device_info for %s", "Could not allocated dmabounce_device_info\n");
dev->bus_id);
return -ENOMEM; return -ENOMEM;
} }
...@@ -594,8 +593,7 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size, ...@@ -594,8 +593,7 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
dev->archdata.dmabounce = device_info; dev->archdata.dmabounce = device_info;
printk(KERN_INFO "dmabounce: registered device %s on %s bus\n", dev_info(dev, "dmabounce: registered device\n");
dev->bus_id, dev->bus->name);
return 0; return 0;
...@@ -614,16 +612,15 @@ dmabounce_unregister_dev(struct device *dev) ...@@ -614,16 +612,15 @@ dmabounce_unregister_dev(struct device *dev)
dev->archdata.dmabounce = NULL; dev->archdata.dmabounce = NULL;
if (!device_info) { if (!device_info) {
printk(KERN_WARNING dev_warn(dev,
"%s: Never registered with dmabounce but attempting" \ "Never registered with dmabounce but attempting"
"to unregister!\n", dev->bus_id); "to unregister!\n");
return; return;
} }
if (!list_empty(&device_info->safe_buffers)) { if (!list_empty(&device_info->safe_buffers)) {
printk(KERN_ERR dev_err(dev,
"%s: Removing from dmabounce with pending buffers!\n", "Removing from dmabounce with pending buffers!\n");
dev->bus_id);
BUG(); BUG();
} }
...@@ -639,8 +636,7 @@ dmabounce_unregister_dev(struct device *dev) ...@@ -639,8 +636,7 @@ dmabounce_unregister_dev(struct device *dev)
kfree(device_info); kfree(device_info);
printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n", dev_info(dev, "dmabounce: device unregistered\n");
dev->bus_id, dev->bus->name);
} }
......
...@@ -593,7 +593,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent, ...@@ -593,7 +593,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
if (dev->dma_mask != 0xffffffffUL) { if (dev->dma_mask != 0xffffffffUL) {
ret = dmabounce_register_dev(&dev->dev, 1024, 4096); ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
if (ret) { if (ret) {
printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id); dev_err(&dev->dev, "SA1111: Failed to register"
" with dmabounce\n");
device_unregister(&dev->dev); device_unregister(&dev->dev);
} }
} }
......
...@@ -853,8 +853,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot) ...@@ -853,8 +853,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
for (i = 0; i < ECARD_NUM_RESOURCES; i++) { for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
if (ec->resource[i].flags && if (ec->resource[i].flags &&
request_resource(&iomem_resource, &ec->resource[i])) { request_resource(&iomem_resource, &ec->resource[i])) {
printk(KERN_ERR "%s: resource(s) not available\n", dev_err(&ec->dev, "resource(s) not available\n");
ec->dev.bus_id);
ec->resource[i].end -= ec->resource[i].start; ec->resource[i].end -= ec->resource[i].start;
ec->resource[i].start = 0; ec->resource[i].start = 0;
ec->resource[i].flags = 0; ec->resource[i].flags = 0;
......
...@@ -407,8 +407,7 @@ static int impd1_probe(struct lm_device *dev) ...@@ -407,8 +407,7 @@ static int impd1_probe(struct lm_device *dev)
ret = amba_device_register(d, &dev->resource); ret = amba_device_register(d, &dev->resource);
if (ret) { if (ret) {
printk("unable to register device %s: %d\n", dev_err(&d->dev, "unable to register device: %d\n");
d->dev.bus_id, ret);
kfree(d); kfree(d);
} }
} }
......
...@@ -367,7 +367,7 @@ static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide) ...@@ -367,7 +367,7 @@ static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL); viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
if (!viaisa) if (!viaisa)
return; return;
printk("Fixing VIA IDE, force legacy mode on '%s'\n", viaide->dev.bus_id); dev_info(&viaide->dev, "Fixing VIA IDE, force legacy mode on\n");
pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif); pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif);
pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5); pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5);
......
...@@ -314,8 +314,7 @@ int dma_supported(struct device *dev, u64 mask) ...@@ -314,8 +314,7 @@ int dma_supported(struct device *dev, u64 mask)
{ {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
if (mask > 0xffffffff && forbid_dac > 0) { if (mask > 0xffffffff && forbid_dac > 0) {
printk(KERN_INFO "PCI: Disallowing DAC for device %s\n", dev_info(dev, "PCI: Disallowing DAC for device\n");
dev->bus_id);
return 0; return 0;
} }
#endif #endif
...@@ -342,8 +341,7 @@ int dma_supported(struct device *dev, u64 mask) ...@@ -342,8 +341,7 @@ int dma_supported(struct device *dev, u64 mask)
type. Normally this doesn't make any difference, but gives type. Normally this doesn't make any difference, but gives
more gentle handling of IOMMU overflow. */ more gentle handling of IOMMU overflow. */
if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) { if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
printk(KERN_INFO "%s: Force SAC with mask %Lx\n", dev_info(dev, "Force SAC with mask %Lx\n", mask);
dev->bus_id, mask);
return 0; return 0;
} }
......
...@@ -198,9 +198,7 @@ static void iommu_full(struct device *dev, size_t size, int dir) ...@@ -198,9 +198,7 @@ static void iommu_full(struct device *dev, size_t size, int dir)
* out. Hopefully no network devices use single mappings that big. * out. Hopefully no network devices use single mappings that big.
*/ */
printk(KERN_ERR dev_err(dev, "PCI-DMA: Out of IOMMU space for %lu bytes\n", size);
"PCI-DMA: Out of IOMMU space for %lu bytes at device %s\n",
size, dev->bus_id);
if (size > PAGE_SIZE*EMERGENCY_PAGES) { if (size > PAGE_SIZE*EMERGENCY_PAGES) {
if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL) if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
......
...@@ -263,22 +263,22 @@ static int acpi_fan_add(struct acpi_device *device) ...@@ -263,22 +263,22 @@ static int acpi_fan_add(struct acpi_device *device)
goto end; goto end;
} }
printk(KERN_INFO PREFIX dev_info(&device->dev, "registered as cooling_device%d\n", cdev->id);
"%s is registered as cooling_device%d\n",
device->dev.bus_id, cdev->id);
acpi_driver_data(device) = cdev; acpi_driver_data(device) = cdev;
result = sysfs_create_link(&device->dev.kobj, result = sysfs_create_link(&device->dev.kobj,
&cdev->device.kobj, &cdev->device.kobj,
"thermal_cooling"); "thermal_cooling");
if (result) if (result)
printk(KERN_ERR PREFIX "Create sysfs link\n"); dev_err(&device->dev, "Failed to create sysfs link "
"'thermal_cooling'\n");
result = sysfs_create_link(&cdev->device.kobj, result = sysfs_create_link(&cdev->device.kobj,
&device->dev.kobj, &device->dev.kobj,
"device"); "device");
if (result) if (result)
printk(KERN_ERR PREFIX "Create sysfs link\n"); dev_err(&device->dev, "Failed to create sysfs link "
"'device'\n");
result = acpi_fan_add_fs(device); result = acpi_fan_add_fs(device);
if (result) if (result)
......
...@@ -146,8 +146,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle) ...@@ -146,8 +146,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
acpi_status status; acpi_status status;
if (dev->archdata.acpi_handle) { if (dev->archdata.acpi_handle) {
printk(KERN_WARNING PREFIX dev_warn(dev, "Drivers changed 'acpi_handle'\n");
"Drivers changed 'acpi_handle' for %s\n", dev->bus_id);
return -EINVAL; return -EINVAL;
} }
get_device(dev); get_device(dev);
...@@ -195,8 +194,7 @@ static int acpi_unbind_one(struct device *dev) ...@@ -195,8 +194,7 @@ static int acpi_unbind_one(struct device *dev)
/* acpi_bind_one increase refcnt by one */ /* acpi_bind_one increase refcnt by one */
put_device(dev); put_device(dev);
} else { } else {
printk(KERN_ERR PREFIX dev_err(dev, "Oops, 'acpi_handle' corrupt\n");
"Oops, 'acpi_handle' corrupt for %s\n", dev->bus_id);
} }
return 0; return 0;
} }
......
...@@ -714,9 +714,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) ...@@ -714,9 +714,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
goto end; goto end;
} }
printk(KERN_INFO PREFIX dev_info(&device->dev, "registered as cooling_device%d\n",
"%s is registered as cooling_device%d\n", pr->cdev->id);
device->dev.bus_id, pr->cdev->id);
result = sysfs_create_link(&device->dev.kobj, result = sysfs_create_link(&device->dev.kobj,
&pr->cdev->device.kobj, &pr->cdev->device.kobj,
......
...@@ -471,7 +471,7 @@ static int acpi_device_register(struct acpi_device *device, ...@@ -471,7 +471,7 @@ static int acpi_device_register(struct acpi_device *device,
device->dev.release = &acpi_device_release; device->dev.release = &acpi_device_release;
result = device_add(&device->dev); result = device_add(&device->dev);
if(result) { if(result) {
printk(KERN_ERR PREFIX "Error adding device %s", device->dev.bus_id); dev_err(&device->dev, "Error adding device\n");
goto end; goto end;
} }
......
...@@ -1179,8 +1179,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) ...@@ -1179,8 +1179,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
tz->tz_enabled = 1; tz->tz_enabled = 1;
printk(KERN_INFO PREFIX "%s is registered as thermal_zone%d\n", dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
tz->device->dev.bus_id, tz->thermal_zone->id); tz->thermal_zone->id);
return 0; return 0;
} }
......
...@@ -762,9 +762,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) ...@@ -762,9 +762,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
if (IS_ERR(device->cdev)) if (IS_ERR(device->cdev))
return; return;
printk(KERN_INFO PREFIX dev_info(&device->dev->dev, "registered as cooling_device%d\n",
"%s is registered as cooling_device%d\n", device->cdev->id);
device->dev->dev.bus_id, device->cdev->id);
result = sysfs_create_link(&device->dev->dev.kobj, result = sysfs_create_link(&device->dev->dev.kobj,
&device->cdev->device.kobj, &device->cdev->device.kobj,
"thermal_cooling"); "thermal_cooling");
......
...@@ -194,7 +194,7 @@ static int show_dev_hash(unsigned int value) ...@@ -194,7 +194,7 @@ static int show_dev_hash(unsigned int value)
struct device * dev = to_device(entry); struct device * dev = to_device(entry);
unsigned int hash = hash_string(DEVSEED, dev->bus_id, DEVHASH); unsigned int hash = hash_string(DEVSEED, dev->bus_id, DEVHASH);
if (hash == value) { if (hash == value) {
printk(" hash matches device %s\n", dev->bus_id); dev_info(dev, "hash matches\n");
match++; match++;
} }
entry = entry->prev; entry = entry->prev;
......
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