@@ -605,68 +605,6 @@ sdev_show_##field (struct device *dev, struct device_attribute *attr, \
605605 sdev_show_function(field, format_string) \
606606static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL);
607607
608-
609- /*
610- * sdev_rw_attr: create a function and attribute variable for a
611- * read/write field.
612- */
613- #define sdev_rw_attr (field , format_string ) \
614- sdev_show_function(field, format_string) \
615- \
616- static ssize_t \
617- sdev_store_##field (struct device *dev, struct device_attribute *attr, \
618- const char *buf, size_t count) \
619- { \
620- struct scsi_device *sdev; \
621- sdev = to_scsi_device(dev); \
622- sscanf (buf, format_string, &sdev->field); \
623- return count; \
624- } \
625- static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field);
626-
627- /* Currently we don't export bit fields, but we might in future,
628- * so leave this code in */
629- #if 0
630- /*
631- * sdev_rd_attr: create a function and attribute variable for a
632- * read/write bit field.
633- */
634- #define sdev_rw_attr_bit (field ) \
635- sdev_show_function(field, "%d\n") \
636- \
637- static ssize_t \
638- sdev_store_##field (struct device *dev, struct device_attribute *attr, \
639- const char *buf, size_t count) \
640- { \
641- int ret; \
642- struct scsi_device *sdev; \
643- ret = scsi_sdev_check_buf_bit(buf); \
644- if (ret >= 0) { \
645- sdev = to_scsi_device(dev); \
646- sdev->field = ret; \
647- ret = count; \
648- } \
649- return ret; \
650- } \
651- static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field);
652-
653- /*
654- * scsi_sdev_check_buf_bit: return 0 if buf is "0", return 1 if buf is "1",
655- * else return -EINVAL.
656- */
657- static int scsi_sdev_check_buf_bit (const char * buf )
658- {
659- if ((buf [1 ] == '\0' ) || ((buf [1 ] == '\n' ) && (buf [2 ] == '\0' ))) {
660- if (buf [0 ] == '1' )
661- return 1 ;
662- else if (buf [0 ] == '0' )
663- return 0 ;
664- else
665- return - EINVAL ;
666- } else
667- return - EINVAL ;
668- }
669- #endif
670608/*
671609 * Create the actual show/store functions and data structures.
672610 */
0 commit comments