int i2o_claim_device(struct i2o_device *d, struct i2o_handler *h)
{
+ int ret = 0;
+
down(&i2o_configuration_lock);
if (d->owner) {
printk(KERN_INFO "Device claim called, but dev already owned by %s!",
h->name);
- up(&i2o_configuration_lock);
- return -EBUSY;
+ ret = -EBUSY;
+ goto out;
}
d->owner=h;
I2O_CLAIM_PRIMARY))
{
d->owner = NULL;
- return -EBUSY;
+ ret = -EBUSY;
}
+out:
up(&i2o_configuration_lock);
- return 0;
+ return ret;
}
/**