scsi_sysfs.c (e752ab11dcb48353727ea26eefd740155e028865) scsi_sysfs.c (31435de9746670d884f84a3c094a401aa27747aa)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * scsi_sysfs.c
4 *
5 * SCSI sysfs interface routines.
6 *
7 * Created to pull SCSI mid layer sysfs routines into one file.
8 */

--- 282 unchanged lines hidden (view full) ---

291 return 0;
292}
293
294static ssize_t
295store_host_reset(struct device *dev, struct device_attribute *attr,
296 const char *buf, size_t count)
297{
298 struct Scsi_Host *shost = class_to_shost(dev);
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * scsi_sysfs.c
4 *
5 * SCSI sysfs interface routines.
6 *
7 * Created to pull SCSI mid layer sysfs routines into one file.
8 */

--- 282 unchanged lines hidden (view full) ---

291 return 0;
292}
293
294static ssize_t
295store_host_reset(struct device *dev, struct device_attribute *attr,
296 const char *buf, size_t count)
297{
298 struct Scsi_Host *shost = class_to_shost(dev);
299 struct scsi_host_template *sht = shost->hostt;
299 const struct scsi_host_template *sht = shost->hostt;
300 int ret = -EINVAL;
301 int type;
302
303 type = check_reset_type(buf);
304 if (!type)
305 goto exit_store_host_reset;
306
307 if (sht->host_reset)

--- 712 unchanged lines hidden (view full) ---

1020DECLARE_EVT(lun_change_reported, LUN_CHANGE_REPORTED)
1021
1022static ssize_t
1023sdev_store_queue_depth(struct device *dev, struct device_attribute *attr,
1024 const char *buf, size_t count)
1025{
1026 int depth, retval;
1027 struct scsi_device *sdev = to_scsi_device(dev);
300 int ret = -EINVAL;
301 int type;
302
303 type = check_reset_type(buf);
304 if (!type)
305 goto exit_store_host_reset;
306
307 if (sht->host_reset)

--- 712 unchanged lines hidden (view full) ---

1020DECLARE_EVT(lun_change_reported, LUN_CHANGE_REPORTED)
1021
1022static ssize_t
1023sdev_store_queue_depth(struct device *dev, struct device_attribute *attr,
1024 const char *buf, size_t count)
1025{
1026 int depth, retval;
1027 struct scsi_device *sdev = to_scsi_device(dev);
1028 struct scsi_host_template *sht = sdev->host->hostt;
1028 const struct scsi_host_template *sht = sdev->host->hostt;
1029
1030 if (!sht->change_queue_depth)
1031 return -EINVAL;
1032
1033 depth = simple_strtoul(buf, NULL, 0);
1034
1035 if (depth < 1 || depth > sdev->host->can_queue)
1036 return -EINVAL;

--- 564 unchanged lines hidden (view full) ---

1601 .release = scsi_device_dev_release,
1602 .groups = scsi_sdev_attr_groups,
1603};
1604
1605void scsi_sysfs_device_initialize(struct scsi_device *sdev)
1606{
1607 unsigned long flags;
1608 struct Scsi_Host *shost = sdev->host;
1029
1030 if (!sht->change_queue_depth)
1031 return -EINVAL;
1032
1033 depth = simple_strtoul(buf, NULL, 0);
1034
1035 if (depth < 1 || depth > sdev->host->can_queue)
1036 return -EINVAL;

--- 564 unchanged lines hidden (view full) ---

1601 .release = scsi_device_dev_release,
1602 .groups = scsi_sdev_attr_groups,
1603};
1604
1605void scsi_sysfs_device_initialize(struct scsi_device *sdev)
1606{
1607 unsigned long flags;
1608 struct Scsi_Host *shost = sdev->host;
1609 struct scsi_host_template *hostt = shost->hostt;
1609 const struct scsi_host_template *hostt = shost->hostt;
1610 struct scsi_target *starget = sdev->sdev_target;
1611
1612 device_initialize(&sdev->sdev_gendev);
1613 sdev->sdev_gendev.bus = &scsi_bus_type;
1614 sdev->sdev_gendev.type = &scsi_dev_type;
1615 scsi_enable_async_suspend(&sdev->sdev_gendev);
1616 dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu",
1617 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);

--- 42 unchanged lines hidden ---
1610 struct scsi_target *starget = sdev->sdev_target;
1611
1612 device_initialize(&sdev->sdev_gendev);
1613 sdev->sdev_gendev.bus = &scsi_bus_type;
1614 sdev->sdev_gendev.type = &scsi_dev_type;
1615 scsi_enable_async_suspend(&sdev->sdev_gendev);
1616 dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu",
1617 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);

--- 42 unchanged lines hidden ---