]> git.hungrycats.org Git - linux/commitdiff
sysfs: fixup SCSI sysfs files
authorPatrick Mochel <mochel@osdl.org>
Mon, 13 Jan 2003 05:38:44 +0000 (23:38 -0600)
committerPatrick Mochel <mochel@osdl.org>
Mon, 13 Jan 2003 05:38:44 +0000 (23:38 -0600)
- 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.

drivers/scsi/osst.c
drivers/scsi/scsi_sysfs.c
drivers/scsi/st.c

index f7c3379dafe34e3b1e96184298de3d4e958e342b..1c2a41c621aaa23c105436f0de531027e2ce0cda 100644 (file)
@@ -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);
 
index e1877642139714621aad3eb8105c1a2a0fe1a913..9a7b256add6ac8b5e62232a865e13d526eb35009 100644 (file)
@@ -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;                                                     \
 }                                                                      \
index b463de9d1367cb5c651cc3c846842bafe7cafc61..7f38fe7f0b3ecb80747b662c995122ffa4c2e832 100644 (file)
@@ -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);