Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_sysfs.c
index 24f6eefb68030d39869934e6fbefc9fce11d640b..775df00021e4d5591044d8e3272bb435a11cfa6a 100644 (file)
@@ -27,7 +27,7 @@
 #include "scsi_priv.h"
 #include "scsi_logging.h"
 
-static struct device_type scsi_dev_type;
+static const struct device_type scsi_dev_type;
 
 static const struct {
        enum scsi_device_state  value;
@@ -449,6 +449,7 @@ static void scsi_device_dev_release(struct device *dev)
        struct scsi_vpd *vpd_pg80 = NULL, *vpd_pg83 = NULL;
        struct scsi_vpd *vpd_pg0 = NULL, *vpd_pg89 = NULL;
        struct scsi_vpd *vpd_pgb0 = NULL, *vpd_pgb1 = NULL, *vpd_pgb2 = NULL;
+       struct scsi_vpd *vpd_pgb7 = NULL;
        unsigned long flags;
 
        might_sleep();
@@ -494,6 +495,8 @@ static void scsi_device_dev_release(struct device *dev)
                                       lockdep_is_held(&sdev->inquiry_mutex));
        vpd_pgb2 = rcu_replace_pointer(sdev->vpd_pgb2, vpd_pgb2,
                                       lockdep_is_held(&sdev->inquiry_mutex));
+       vpd_pgb7 = rcu_replace_pointer(sdev->vpd_pgb7, vpd_pgb7,
+                                      lockdep_is_held(&sdev->inquiry_mutex));
        mutex_unlock(&sdev->inquiry_mutex);
 
        if (vpd_pg0)
@@ -510,6 +513,8 @@ static void scsi_device_dev_release(struct device *dev)
                kfree_rcu(vpd_pgb1, rcu);
        if (vpd_pgb2)
                kfree_rcu(vpd_pgb2, rcu);
+       if (vpd_pgb7)
+               kfree_rcu(vpd_pgb7, rcu);
        kfree(sdev->inquiry);
        kfree(sdev);
 
@@ -549,7 +554,7 @@ static int scsi_bus_uevent(const struct device *dev, struct kobj_uevent_env *env
        return 0;
 }
 
-struct bus_type scsi_bus_type = {
+const struct bus_type scsi_bus_type = {
         .name          = "scsi",
         .match         = scsi_bus_match,
        .uevent         = scsi_bus_uevent,
@@ -921,6 +926,7 @@ sdev_vpd_pg_attr(pg89);
 sdev_vpd_pg_attr(pgb0);
 sdev_vpd_pg_attr(pgb1);
 sdev_vpd_pg_attr(pgb2);
+sdev_vpd_pg_attr(pgb7);
 sdev_vpd_pg_attr(pg0);
 
 static ssize_t show_inquiry(struct file *filep, struct kobject *kobj,
@@ -1295,6 +1301,9 @@ static umode_t scsi_sdev_bin_attr_is_visible(struct kobject *kobj,
        if (attr == &dev_attr_vpd_pgb2 && !sdev->vpd_pgb2)
                return 0;
 
+       if (attr == &dev_attr_vpd_pgb7 && !sdev->vpd_pgb7)
+               return 0;
+
        return S_IRUGO;
 }
 
@@ -1347,6 +1356,7 @@ static struct bin_attribute *scsi_sdev_bin_attrs[] = {
        &dev_attr_vpd_pgb0,
        &dev_attr_vpd_pgb1,
        &dev_attr_vpd_pgb2,
+       &dev_attr_vpd_pgb7,
        &dev_attr_inquiry,
        NULL
 };
@@ -1626,7 +1636,7 @@ int scsi_sysfs_add_host(struct Scsi_Host *shost)
        return 0;
 }
 
-static struct device_type scsi_dev_type = {
+static const struct device_type scsi_dev_type = {
        .name =         "scsi_device",
        .release =      scsi_device_dev_release,
        .groups =       scsi_sdev_attr_groups,