Commit 97e0a333 authored by Patrick Mansfield's avatar Patrick Mansfield Committed by James Bottomley

[PATCH] fix return value of scsi_device rescan attribute

When writing to the rescan attribute, return count as result, otherwise
some user apps might retry the write forever.

And remove the read capability of the attribute.
parent 4d6c3d20
......@@ -194,20 +194,14 @@ sdev_rd_attr (model, "%.16s\n");
sdev_rd_attr (rev, "%.4s\n");
sdev_rw_attr_bit (online);
static ssize_t
show_rescan_field (struct device *dev, char *buf)
{
return 0;
}
static ssize_t
store_rescan_field (struct device *dev, const char *buf, size_t count)
{
scsi_rescan_device(dev);
return 0;
return count;
}
static DEVICE_ATTR(rescan, S_IRUGO | S_IWUSR, show_rescan_field, store_rescan_field)
static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field)
/* Default template for device attributes. May NOT be modified */
struct device_attribute *scsi_sysfs_sdev_attrs[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment