aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_sysfs.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2007-09-25 23:45:53 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-17 21:56:12 -0400
commit7a39ac3f25bef018862a991d754aff681c019127 (patch)
treeddbe694e36e2d2fb4648c0775e8f152afcfa9fe9 /drivers/scsi/scsi_sysfs.c
parent645a0c6c48e0122f4212e3957e73bddc18788d99 (diff)
[SCSI] make supported_mode default to initiator.
if shost->supported mode is zero (i.e. MODE_UNKNOWN) show it as initiator (it's obviously an unconverted driver that won't do target). Acked-by: FUJITA Tomonori <tomof@acm.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r--drivers/scsi/scsi_sysfs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index daed37df00b1..d531ceeb0d8c 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
209static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf) 209static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
210{ 210{
211 struct Scsi_Host *shost = class_to_shost(class_dev); 211 struct Scsi_Host *shost = class_to_shost(class_dev);
212 unsigned int supported_mode = shost->hostt->supported_mode;
212 213
213 if (shost->hostt->supported_mode == MODE_UNKNOWN) 214 if (supported_mode == MODE_UNKNOWN)
214 return snprintf(buf, 20, "unknown\n"); 215 /* by default this should be initiator */
215 else 216 supported_mode = MODE_INITIATOR;
216 return show_shost_mode(shost->hostt->supported_mode, buf); 217
218 return show_shost_mode(supported_mode, buf);
217} 219}
218 220
219static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL); 221static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);