aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/vio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/vio.c')
-rw-r--r--arch/sparc64/kernel/vio.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c
index e78b3517940b..a490077891a4 100644
--- a/arch/sparc64/kernel/vio.c
+++ b/arch/sparc64/kernel/vio.c
@@ -224,7 +224,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
224 if (!strcmp(type, "domain-services-port")) 224 if (!strcmp(type, "domain-services-port"))
225 bus_id_name = "ds"; 225 bus_id_name = "ds";
226 226
227 if (strlen(bus_id_name) >= KOBJ_NAME_LEN - 4) { 227 if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) {
228 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n", 228 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
229 bus_id_name); 229 bus_id_name);
230 return NULL; 230 return NULL;
@@ -260,16 +260,14 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
260 vio_fill_channel_info(hp, mp, vdev); 260 vio_fill_channel_info(hp, mp, vdev);
261 261
262 if (!id) { 262 if (!id) {
263 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s", 263 dev_set_name(&vdev->dev, "%s", bus_id_name);
264 bus_id_name);
265 vdev->dev_no = ~(u64)0; 264 vdev->dev_no = ~(u64)0;
266 } else if (!cfg_handle) { 265 } else if (!cfg_handle) {
267 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu", 266 dev_set_name(&vdev->dev, "%s-%lu", bus_id_name, *id);
268 bus_id_name, *id);
269 vdev->dev_no = *id; 267 vdev->dev_no = *id;
270 } else { 268 } else {
271 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu-%lu", 269 dev_set_name(&vdev->dev, "%s-%lu-%lu", bus_id_name,
272 bus_id_name, *cfg_handle, *id); 270 *cfg_handle, *id);
273 vdev->dev_no = *cfg_handle; 271 vdev->dev_no = *cfg_handle;
274 } 272 }
275 273
@@ -292,12 +290,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
292 } 290 }
293 vdev->dp = dp; 291 vdev->dp = dp;
294 292
295 printk(KERN_INFO "VIO: Adding device %s\n", vdev->dev.bus_id); 293 printk(KERN_INFO "VIO: Adding device %s\n", dev_name(&vdev->dev));
296 294
297 err = device_register(&vdev->dev); 295 err = device_register(&vdev->dev);
298 if (err) { 296 if (err) {
299 printk(KERN_ERR "VIO: Could not register device %s, err=%d\n", 297 printk(KERN_ERR "VIO: Could not register device %s, err=%d\n",
300 vdev->dev.bus_id, err); 298 dev_name(&vdev->dev), err);
301 kfree(vdev); 299 kfree(vdev);
302 return NULL; 300 return NULL;
303 } 301 }
@@ -330,7 +328,7 @@ static void vio_remove(struct mdesc_handle *hp, u64 node)
330 dev = device_find_child(&root_vdev->dev, (void *) node, 328 dev = device_find_child(&root_vdev->dev, (void *) node,
331 vio_md_node_match); 329 vio_md_node_match);
332 if (dev) { 330 if (dev) {
333 printk(KERN_INFO "VIO: Removing device %s\n", dev->bus_id); 331 printk(KERN_INFO "VIO: Removing device %s\n", dev_name(dev));
334 332
335 device_unregister(dev); 333 device_unregister(dev);
336 } 334 }