/* Returns 0 on success or negative error code on failure.  */
static int i2o_block_release(struct gendisk *disk, fmode_t mode)
/* Returns 0 on success or negative error code on failure.  */
static int i2o_block_release(struct gendisk *disk, fmode_t mode)
{
	struct i2o_block_device *dev = disk->private_data;
	u8 operation;
	if (!dev->i2o_dev)
		return 0;
	i2o_block_device_flush(dev->i2o_dev);
	i2o_block_device_unlock(dev->i2o_dev, -1);
	if (dev->flags & (1 << 3 | 1 << 4))
		operation = 0x21;
	else
		operation = 0x24;
	i2o_block_device_power(dev, operation);
	return 0;
}