]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/scsi_sysfs.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6-omap-h63xx.git] / drivers / scsi / scsi_sysfs.c
index 8e880ef8b797a32ad2d3bff3f055241eec72f75a..d531ceeb0d8c3925c83b6dfdafa89d2c56e993e7 100644 (file)
@@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
 static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
 {
        struct Scsi_Host *shost = class_to_shost(class_dev);
+       unsigned int supported_mode = shost->hostt->supported_mode;
 
-       if (shost->hostt->supported_mode == MODE_UNKNOWN)
-               return snprintf(buf, 20, "unknown\n");
-       else
-               return show_shost_mode(shost->hostt->supported_mode, buf);
+       if (supported_mode == MODE_UNKNOWN)
+               /* by default this should be initiator */
+               supported_mode = MODE_INITIATOR;
+
+       return show_shost_mode(supported_mode, buf);
 }
 
 static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
@@ -319,16 +321,11 @@ static int scsi_bus_match(struct device *dev, struct device_driver *gendrv)
        return (sdp->inq_periph_qual == SCSI_INQ_PQ_CON)? 1: 0;
 }
 
-static int scsi_bus_uevent(struct device *dev, char **envp, int num_envp,
-                          char *buffer, int buffer_size)
+static int scsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
        struct scsi_device *sdev = to_scsi_device(dev);
-       int i = 0;
-       int length = 0;
 
-       add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
-                      "MODALIAS=" SCSI_DEVICE_MODALIAS_FMT, sdev->type);
-       envp[i] = NULL;
+       add_uevent_var(env, "MODALIAS=" SCSI_DEVICE_MODALIAS_FMT, sdev->type);
        return 0;
 }