diff options
Diffstat (limited to 'drivers/scsi/osst.c')
-rw-r--r-- | drivers/scsi/osst.c | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index abef7048f25..31f7aec44d9 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c | |||
@@ -5591,9 +5591,10 @@ static void osst_remove_sysfs_files(struct device_driver *sysfs) | |||
5591 | * sysfs support for accessing ADR header information | 5591 | * sysfs support for accessing ADR header information |
5592 | */ | 5592 | */ |
5593 | 5593 | ||
5594 | static ssize_t osst_adr_rev_show(struct class_device *class_dev, char *buf) | 5594 | static ssize_t osst_adr_rev_show(struct device *dev, |
5595 | struct device_attribute *attr, char *buf) | ||
5595 | { | 5596 | { |
5596 | struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); | 5597 | struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); |
5597 | ssize_t l = 0; | 5598 | ssize_t l = 0; |
5598 | 5599 | ||
5599 | if (STp && STp->header_ok && STp->linux_media) | 5600 | if (STp && STp->header_ok && STp->linux_media) |
@@ -5601,11 +5602,13 @@ static ssize_t osst_adr_rev_show(struct class_device *class_dev, char *buf) | |||
5601 | return l; | 5602 | return l; |
5602 | } | 5603 | } |
5603 | 5604 | ||
5604 | CLASS_DEVICE_ATTR(ADR_rev, S_IRUGO, osst_adr_rev_show, NULL); | 5605 | DEVICE_ATTR(ADR_rev, S_IRUGO, osst_adr_rev_show, NULL); |
5605 | 5606 | ||
5606 | static ssize_t osst_linux_media_version_show(struct class_device *class_dev, char *buf) | 5607 | static ssize_t osst_linux_media_version_show(struct device *dev, |
5608 | struct device_attribute *attr, | ||
5609 | char *buf) | ||
5607 | { | 5610 | { |
5608 | struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); | 5611 | struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); |
5609 | ssize_t l = 0; | 5612 | ssize_t l = 0; |
5610 | 5613 | ||
5611 | if (STp && STp->header_ok && STp->linux_media) | 5614 | if (STp && STp->header_ok && STp->linux_media) |
@@ -5613,11 +5616,12 @@ static ssize_t osst_linux_media_version_show(struct class_device *class_dev, cha | |||
5613 | return l; | 5616 | return l; |
5614 | } | 5617 | } |
5615 | 5618 | ||
5616 | CLASS_DEVICE_ATTR(media_version, S_IRUGO, osst_linux_media_version_show, NULL); | 5619 | DEVICE_ATTR(media_version, S_IRUGO, osst_linux_media_version_show, NULL); |
5617 | 5620 | ||
5618 | static ssize_t osst_capacity_show(struct class_device *class_dev, char *buf) | 5621 | static ssize_t osst_capacity_show(struct device *dev, |
5622 | struct device_attribute *attr, char *buf) | ||
5619 | { | 5623 | { |
5620 | struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); | 5624 | struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); |
5621 | ssize_t l = 0; | 5625 | ssize_t l = 0; |
5622 | 5626 | ||
5623 | if (STp && STp->header_ok && STp->linux_media) | 5627 | if (STp && STp->header_ok && STp->linux_media) |
@@ -5625,11 +5629,13 @@ static ssize_t osst_capacity_show(struct class_device *class_dev, char *buf) | |||
5625 | return l; | 5629 | return l; |
5626 | } | 5630 | } |
5627 | 5631 | ||
5628 | CLASS_DEVICE_ATTR(capacity, S_IRUGO, osst_capacity_show, NULL); | 5632 | DEVICE_ATTR(capacity, S_IRUGO, osst_capacity_show, NULL); |
5629 | 5633 | ||
5630 | static ssize_t osst_first_data_ppos_show(struct class_device *class_dev, char *buf) | 5634 | static ssize_t osst_first_data_ppos_show(struct device *dev, |
5635 | struct device_attribute *attr, | ||
5636 | char *buf) | ||
5631 | { | 5637 | { |
5632 | struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); | 5638 | struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); |
5633 | ssize_t l = 0; | 5639 | ssize_t l = 0; |
5634 | 5640 | ||
5635 | if (STp && STp->header_ok && STp->linux_media) | 5641 | if (STp && STp->header_ok && STp->linux_media) |
@@ -5637,11 +5643,13 @@ static ssize_t osst_first_data_ppos_show(struct class_device *class_dev, char *b | |||
5637 | return l; | 5643 | return l; |
5638 | } | 5644 | } |
5639 | 5645 | ||
5640 | CLASS_DEVICE_ATTR(BOT_frame, S_IRUGO, osst_first_data_ppos_show, NULL); | 5646 | DEVICE_ATTR(BOT_frame, S_IRUGO, osst_first_data_ppos_show, NULL); |
5641 | 5647 | ||
5642 | static ssize_t osst_eod_frame_ppos_show(struct class_device *class_dev, char *buf) | 5648 | static ssize_t osst_eod_frame_ppos_show(struct device *dev, |
5649 | struct device_attribute *attr, | ||
5650 | char *buf) | ||
5643 | { | 5651 | { |
5644 | struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); | 5652 | struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); |
5645 | ssize_t l = 0; | 5653 | ssize_t l = 0; |
5646 | 5654 | ||
5647 | if (STp && STp->header_ok && STp->linux_media) | 5655 | if (STp && STp->header_ok && STp->linux_media) |
@@ -5649,11 +5657,12 @@ static ssize_t osst_eod_frame_ppos_show(struct class_device *class_dev, char *bu | |||
5649 | return l; | 5657 | return l; |
5650 | } | 5658 | } |
5651 | 5659 | ||
5652 | CLASS_DEVICE_ATTR(EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL); | 5660 | DEVICE_ATTR(EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL); |
5653 | 5661 | ||
5654 | static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf) | 5662 | static ssize_t osst_filemark_cnt_show(struct device *dev, |
5663 | struct device_attribute *attr, char *buf) | ||
5655 | { | 5664 | { |
5656 | struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); | 5665 | struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); |
5657 | ssize_t l = 0; | 5666 | ssize_t l = 0; |
5658 | 5667 | ||
5659 | if (STp && STp->header_ok && STp->linux_media) | 5668 | if (STp && STp->header_ok && STp->linux_media) |
@@ -5661,7 +5670,7 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf) | |||
5661 | return l; | 5670 | return l; |
5662 | } | 5671 | } |
5663 | 5672 | ||
5664 | CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); | 5673 | DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); |
5665 | 5674 | ||
5666 | static struct class *osst_sysfs_class; | 5675 | static struct class *osst_sysfs_class; |
5667 | 5676 | ||
@@ -5678,44 +5687,37 @@ static int osst_sysfs_init(void) | |||
5678 | 5687 | ||
5679 | static void osst_sysfs_destroy(dev_t dev) | 5688 | static void osst_sysfs_destroy(dev_t dev) |
5680 | { | 5689 | { |
5681 | class_device_destroy(osst_sysfs_class, dev); | 5690 | device_destroy(osst_sysfs_class, dev); |
5682 | } | 5691 | } |
5683 | 5692 | ||
5684 | static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * STp, char * name) | 5693 | static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * STp, char * name) |
5685 | { | 5694 | { |
5686 | struct class_device *osst_class_member; | 5695 | struct device *osst_member; |
5687 | int err; | 5696 | int err; |
5688 | 5697 | ||
5689 | osst_class_member = class_device_create(osst_sysfs_class, NULL, dev, | 5698 | osst_member = device_create(osst_sysfs_class, device, dev, "%s", name); |
5690 | device, "%s", name); | 5699 | if (IS_ERR(osst_member)) { |
5691 | if (IS_ERR(osst_class_member)) { | ||
5692 | printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); | 5700 | printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); |
5693 | return PTR_ERR(osst_class_member); | 5701 | return PTR_ERR(osst_member); |
5694 | } | 5702 | } |
5695 | 5703 | ||
5696 | class_set_devdata(osst_class_member, STp); | 5704 | dev_set_drvdata(osst_member, STp); |
5697 | err = class_device_create_file(osst_class_member, | 5705 | err = device_create_file(osst_member, &dev_attr_ADR_rev); |
5698 | &class_device_attr_ADR_rev); | ||
5699 | if (err) | 5706 | if (err) |
5700 | goto err_out; | 5707 | goto err_out; |
5701 | err = class_device_create_file(osst_class_member, | 5708 | err = device_create_file(osst_member, &dev_attr_media_version); |
5702 | &class_device_attr_media_version); | ||
5703 | if (err) | 5709 | if (err) |
5704 | goto err_out; | 5710 | goto err_out; |
5705 | err = class_device_create_file(osst_class_member, | 5711 | err = device_create_file(osst_member, &dev_attr_capacity); |
5706 | &class_device_attr_capacity); | ||
5707 | if (err) | 5712 | if (err) |
5708 | goto err_out; | 5713 | goto err_out; |
5709 | err = class_device_create_file(osst_class_member, | 5714 | err = device_create_file(osst_member, &dev_attr_BOT_frame); |
5710 | &class_device_attr_BOT_frame); | ||
5711 | if (err) | 5715 | if (err) |
5712 | goto err_out; | 5716 | goto err_out; |
5713 | err = class_device_create_file(osst_class_member, | 5717 | err = device_create_file(osst_member, &dev_attr_EOD_frame); |
5714 | &class_device_attr_EOD_frame); | ||
5715 | if (err) | 5718 | if (err) |
5716 | goto err_out; | 5719 | goto err_out; |
5717 | err = class_device_create_file(osst_class_member, | 5720 | err = device_create_file(osst_member, &dev_attr_file_count); |
5718 | &class_device_attr_file_count); | ||
5719 | if (err) | 5721 | if (err) |
5720 | goto err_out; | 5722 | goto err_out; |
5721 | 5723 | ||