Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42766
b: refs/heads/master
c: 3889b26
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Garzik authored and Linus Torvalds committed Dec 7, 2006
1 parent 438d813 commit 80c71a5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07354a00901d103085e4376b7df0aad264c1836a
refs/heads/master: 3889b26bebd3e3cf5a3b95da683bab2f6462133d
19 changes: 12 additions & 7 deletions trunk/drivers/message/i2o/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,17 @@ static struct i2o_device *i2o_device_alloc(void)
* Allocate a new I2O device and initialize it with the LCT entry. The
* device is appended to the device list of the controller.
*
* Returns a pointer to the I2O device on success or negative error code
* on failure.
* Returns zero on success, or a -ve errno.
*/
static struct i2o_device *i2o_device_add(struct i2o_controller *c,
i2o_lct_entry * entry)
static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry)
{
struct i2o_device *i2o_dev, *tmp;
int rc;

i2o_dev = i2o_device_alloc();
if (IS_ERR(i2o_dev)) {
printk(KERN_ERR "i2o: unable to allocate i2o device\n");
return i2o_dev;
return PTR_ERR(i2o_dev);
}

i2o_dev->lct_data = *entry;
Expand All @@ -236,7 +235,9 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c,
i2o_dev->iop = c;
i2o_dev->device.parent = &c->device;

device_register(&i2o_dev->device);
rc = device_register(&i2o_dev->device);
if (rc)
goto err;

list_add_tail(&i2o_dev->list, &c->devices);

Expand Down Expand Up @@ -270,7 +271,11 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c,

pr_debug("i2o: device %s added\n", i2o_dev->device.bus_id);

return i2o_dev;
return 0;

err:
kfree(i2o_dev);
return rc;
}

/**
Expand Down
12 changes: 9 additions & 3 deletions trunk/drivers/message/i2o/i2o_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static int i2o_scsi_probe(struct device *dev)
u32 id = -1;
u64 lun = -1;
int channel = -1;
int i;
int i, rc;

i2o_shost = i2o_scsi_get_host(c);
if (!i2o_shost)
Expand Down Expand Up @@ -304,14 +304,20 @@ static int i2o_scsi_probe(struct device *dev)
return PTR_ERR(scsi_dev);
}

sysfs_create_link(&i2o_dev->device.kobj, &scsi_dev->sdev_gendev.kobj,
"scsi");
rc = sysfs_create_link(&i2o_dev->device.kobj,
&scsi_dev->sdev_gendev.kobj, "scsi");
if (rc)
goto err;

osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %ld\n",
i2o_dev->lct_data.tid, channel, le32_to_cpu(id),
(long unsigned int)le64_to_cpu(lun));

return 0;

err:
scsi_remove_device(scsi_dev);
return rc;
};

static const char *i2o_scsi_info(struct Scsi_Host *SChost)
Expand Down

0 comments on commit 80c71a5

Please sign in to comment.