===== arch/ppc64/kernel/vio.c 1.5 vs edited ===== --- 1.5/arch/ppc64/kernel/vio.c Tue Feb 24 20:54:12 2004 +++ edited/arch/ppc64/kernel/vio.c Fri Feb 27 12:05:34 2004 @@ -199,6 +199,15 @@ kfree(viodev); } +static ssize_t viodev_show_name(struct device *dev, char *buf) +{ + struct vio_dev *viodev = to_vio_dev(dev); + struct device_node *of_node = viodev->archdata; + + return sprintf(buf, "%s\n", of_node->name); +} +DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL); + /** * vio_register_device: - Register a new vio device. * @of_node: The OF node for this device. @@ -256,8 +265,7 @@ /* init generic 'struct device' fields: */ viodev->dev.parent = &vio_bus_device->dev; viodev->dev.bus = &vio_bus_type; - snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s@%lx", - of_node->name, viodev->unit_address); + snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%lx", viodev->unit_address); viodev->dev.release = vio_dev_release; /* register with generic device framework */ @@ -268,6 +276,7 @@ kfree(viodev); return NULL; } + device_create_file(&viodev->dev, &dev_attr_name); return viodev; }