Commit 3f47b64a authored by Patrick Mochel's avatar Patrick Mochel

sysfs: fixup SCSI sysfs files

- Reinstate count parameter for store() methods.
- Remove off parameter from st.c and osst.c sysfs methods.
- Remove count parameter from st.c and osst.c show() methods.
parent 4b8d028a
......@@ -5325,17 +5325,17 @@ __setup("osst=", osst_setup);
#endif
/* Driverfs file support */
static ssize_t osst_device_kdev_read(struct device *driverfs_dev, char *page, size_t count, loff_t off)
static ssize_t osst_device_kdev_read(struct device *driverfs_dev, char *page)
{
kdev_t kdev;
kdev.value=(int)(long)driverfs_dev->driver_data;
return off ? 0 : sprintf(page, "%x\n",kdev.value);
return sprintf(page, "%x\n",kdev.value);
}
static DEVICE_ATTR(kdev,S_IRUGO,osst_device_kdev_read,NULL);
static ssize_t osst_device_type_read(struct device *driverfs_dev, char *page, size_t count, loff_t off)
static ssize_t osst_device_type_read(struct device *driverfs_dev, char *page)
{
return off ? 0 : sprintf (page, "CHR\n");
return sprintf (page, "CHR\n");
}
static DEVICE_ATTR(type,S_IRUGO,osst_device_type_read,NULL);
......
......@@ -158,12 +158,12 @@ static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL)
show_function(field, format_string) \
\
static ssize_t \
store_##field (struct device *dev, const char *buf) \
store_##field (struct device *dev, const char *buf, size_t count) \
{ \
struct scsi_device *sdev; \
sdev = to_scsi_device(dev); \
snscanf (buf, 20, format_string, &sdev->field); \
return strlen(buf); \
return count; \
} \
static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field)
......@@ -175,7 +175,7 @@ static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field)
show_function(field, "%d\n") \
\
static ssize_t \
store_##field (struct device *dev, const char *buf) \
store_##field (struct device *dev, const char *buf, size_t count) \
{ \
int ret; \
struct scsi_device *sdev; \
......@@ -183,7 +183,7 @@ store_##field (struct device *dev, const char *buf) \
if (ret >= 0) { \
sdev = to_scsi_device(dev); \
sdev->field = ret; \
ret = strlen(buf); \
ret = count; \
} \
return ret; \
} \
......
......@@ -3615,19 +3615,17 @@ __setup("st=", st_setup);
#endif
/* Driverfs file support */
static ssize_t st_device_kdev_read(struct device *driverfs_dev,
char *page, size_t count, loff_t off)
static ssize_t st_device_kdev_read(struct device *dev, char *page)
{
kdev_t kdev;
kdev.value=(int)(long)driverfs_dev->driver_data;
return off ? 0 : sprintf(page, "%x\n",kdev.value);
kdev.value=(int)dev->driver_data;
return sprintf(page, "%x\n",kdev.value);
}
static DEVICE_ATTR(kdev,S_IRUGO,st_device_kdev_read,NULL);
static ssize_t st_device_type_read(struct device *driverfs_dev,
char *page, size_t count, loff_t off)
static ssize_t st_device_type_read(struct device *ev, char * page)
{
return off ? 0 : sprintf (page, "CHR\n");
return sprintf (page, "CHR\n");
}
static DEVICE_ATTR(type,S_IRUGO,st_device_type_read,NULL);
......
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