aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 08:26:54 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 08:26:54 -0700
commit5ac12c6fe1b5fbda0d0caedb8214cde545a5737c (patch)
tree26c7ad8f48ee82d4253a4a8c0637180aa0fb8b0d /drivers
parent52a23685f37c06d0cd00eeb8f517a90de3f2c338 (diff)
parent78d00125398f18f7354e759ba7cd544a6b07f504 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC64]: Fix two year old bug in early bootup asm. [SPARC64]: Update defconfig. [SPARC64]: Fix log message type in vio_create_one(). [SPARC64]: Tweak assertions in sun4v_build_virq(). [SPARC64]: Tweak kernel log messages in power_probe(). [SPARC64]: Fix handling of multiple vdc-port nodes. [SPARC64]: Fix device type matching in VIO's devspec_show(). [SPARC64]: Fix MODULE_DEVICE_TABLE() specification in VDC and VNET. [SPARC]: Add sys_fallocate() entries. [SPARC64]: Use orderly_poweroff().
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/sunvdc.c26
-rw-r--r--drivers/net/sunvnet.c2
2 files changed, 10 insertions, 18 deletions
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 2288b55d916..d50b8238115 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -64,7 +64,6 @@ struct vdc_port {
u64 operations;
u32 vdisk_size;
u8 vdisk_type;
- u8 dev_no;
char disk_name[32];
@@ -703,7 +702,7 @@ static int probe_disk(struct vdc_port *port)
blk_queue_max_phys_segments(q, port->ring_cookies);
blk_queue_max_sectors(q, port->max_xfer_size);
g->major = vdc_major;
- g->first_minor = port->dev_no << PARTITION_SHIFT;
+ g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
strcpy(g->disk_name, port->disk_name);
g->fops = &vdc_fops;
@@ -747,21 +746,16 @@ static int __devinit vdc_port_probe(struct vio_dev *vdev,
{
struct mdesc_handle *hp;
struct vdc_port *port;
- const u64 *port_id;
int err;
print_version();
hp = mdesc_grab();
- port_id = mdesc_get_property(hp, vdev->mp, "id", NULL);
err = -ENODEV;
- if (!port_id) {
- printk(KERN_ERR PFX "Port lacks id property.\n");
- goto err_out_release_mdesc;
- }
- if ((*port_id << PARTITION_SHIFT) & ~(u64)MINORMASK) {
- printk(KERN_ERR PFX "Port id [%lu] too large.\n", *port_id);
+ if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {
+ printk(KERN_ERR PFX "Port id [%lu] too large.\n",
+ vdev->dev_no);
goto err_out_release_mdesc;
}
@@ -772,16 +766,14 @@ static int __devinit vdc_port_probe(struct vio_dev *vdev,
goto err_out_release_mdesc;
}
- port->dev_no = *port_id;
-
- if (port->dev_no >= 26)
+ if (vdev->dev_no >= 26)
snprintf(port->disk_name, sizeof(port->disk_name),
VDCBLK_NAME "%c%c",
- 'a' + (port->dev_no / 26) - 1,
- 'a' + (port->dev_no % 26));
+ 'a' + ((int)vdev->dev_no / 26) - 1,
+ 'a' + ((int)vdev->dev_no % 26));
else
snprintf(port->disk_name, sizeof(port->disk_name),
- VDCBLK_NAME "%c", 'a' + (port->dev_no % 26));
+ VDCBLK_NAME "%c", 'a' + ((int)vdev->dev_no % 26));
err = vio_driver_init(&port->vio, vdev, VDEV_DISK,
vdc_versions, ARRAY_SIZE(vdc_versions),
@@ -849,7 +841,7 @@ static struct vio_device_id vdc_port_match[] = {
},
{},
};
-MODULE_DEVICE_TABLE(vio, vdc_match);
+MODULE_DEVICE_TABLE(vio, vdc_port_match);
static struct vio_driver vdc_port_driver = {
.id_table = vdc_port_match,
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c
index b801e3b3a11..ef0066bab2c 100644
--- a/drivers/net/sunvnet.c
+++ b/drivers/net/sunvnet.c
@@ -1136,7 +1136,7 @@ static struct vio_device_id vnet_port_match[] = {
},
{},
};
-MODULE_DEVICE_TABLE(vio, vnet_match);
+MODULE_DEVICE_TABLE(vio, vnet_port_match);
static struct vio_driver vnet_port_driver = {
.id_table = vnet_port_match,