X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fosst.c;h=31f7aec44d90ff4515327e679137ed418eb66b10;hb=2091a17ff7f32432976d1eacbb79a06819d95301;hp=1c5c4b68f20f1c463b74b05136a1f3e3eeff910a;hpb=1212663fba7c5e003e05d24f043d5ed57eb18b24;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index 1c5c4b68f20..31f7aec44d9 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c @@ -593,10 +593,11 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q if (aux->frame_type != OS_FRAME_TYPE_DATA && aux->frame_type != OS_FRAME_TYPE_EOD && aux->frame_type != OS_FRAME_TYPE_MARKER) { - if (!quiet) + if (!quiet) { #if DEBUG printk(OSST_DEB_MSG "%s:D: Skipping frame, frame type %x\n", name, aux->frame_type); #endif + } goto err_out; } if (aux->frame_type == OS_FRAME_TYPE_EOD && @@ -606,11 +607,12 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q goto err_out; } if (frame_seq_number != -1 && ntohl(aux->frame_seq_num) != frame_seq_number) { - if (!quiet) + if (!quiet) { #if DEBUG printk(OSST_DEB_MSG "%s:D: Skipping frame, sequence number %u (expected %d)\n", name, ntohl(aux->frame_seq_num), frame_seq_number); #endif + } goto err_out; } if (aux->frame_type == OS_FRAME_TYPE_MARKER) { @@ -5256,8 +5258,7 @@ static int enlarge_buffer(struct osst_buffer *STbuffer, int need_dma) STbuffer->sg[0].offset = 0; if (page != NULL) { - sg_set_page(&STbuffer->sg[0], page); - STbuffer->sg[0].length = b_size; + sg_set_page(&STbuffer->sg[0], page, b_size, 0); STbuffer->b_data = page_address(page); break; } @@ -5285,8 +5286,7 @@ static int enlarge_buffer(struct osst_buffer *STbuffer, int need_dma) normalize_buffer(STbuffer); return 0; } - sg_set_page(&STbuffer->sg[segs], page); - STbuffer->sg[segs].length = (OS_FRAME_SIZE - got <= PAGE_SIZE / 2) ? (OS_FRAME_SIZE - got) : b_size; + sg_set_page(&STbuffer->sg[segs], page, (OS_FRAME_SIZE - got <= PAGE_SIZE / 2) ? (OS_FRAME_SIZE - got) : b_size, 0); got += STbuffer->sg[segs].length; STbuffer->buffer_size = got; STbuffer->sg_segs = ++segs; @@ -5591,9 +5591,10 @@ static void osst_remove_sysfs_files(struct device_driver *sysfs) * sysfs support for accessing ADR header information */ -static ssize_t osst_adr_rev_show(struct class_device *class_dev, char *buf) +static ssize_t osst_adr_rev_show(struct device *dev, + struct device_attribute *attr, char *buf) { - struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); + struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); ssize_t l = 0; 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) return l; } -CLASS_DEVICE_ATTR(ADR_rev, S_IRUGO, osst_adr_rev_show, NULL); +DEVICE_ATTR(ADR_rev, S_IRUGO, osst_adr_rev_show, NULL); -static ssize_t osst_linux_media_version_show(struct class_device *class_dev, char *buf) +static ssize_t osst_linux_media_version_show(struct device *dev, + struct device_attribute *attr, + char *buf) { - struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); + struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); ssize_t l = 0; 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 return l; } -CLASS_DEVICE_ATTR(media_version, S_IRUGO, osst_linux_media_version_show, NULL); +DEVICE_ATTR(media_version, S_IRUGO, osst_linux_media_version_show, NULL); -static ssize_t osst_capacity_show(struct class_device *class_dev, char *buf) +static ssize_t osst_capacity_show(struct device *dev, + struct device_attribute *attr, char *buf) { - struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); + struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); ssize_t l = 0; 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) return l; } -CLASS_DEVICE_ATTR(capacity, S_IRUGO, osst_capacity_show, NULL); +DEVICE_ATTR(capacity, S_IRUGO, osst_capacity_show, NULL); -static ssize_t osst_first_data_ppos_show(struct class_device *class_dev, char *buf) +static ssize_t osst_first_data_ppos_show(struct device *dev, + struct device_attribute *attr, + char *buf) { - struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); + struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); ssize_t l = 0; 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 return l; } -CLASS_DEVICE_ATTR(BOT_frame, S_IRUGO, osst_first_data_ppos_show, NULL); +DEVICE_ATTR(BOT_frame, S_IRUGO, osst_first_data_ppos_show, NULL); -static ssize_t osst_eod_frame_ppos_show(struct class_device *class_dev, char *buf) +static ssize_t osst_eod_frame_ppos_show(struct device *dev, + struct device_attribute *attr, + char *buf) { - struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); + struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); ssize_t l = 0; 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 return l; } -CLASS_DEVICE_ATTR(EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL); +DEVICE_ATTR(EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL); -static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf) +static ssize_t osst_filemark_cnt_show(struct device *dev, + struct device_attribute *attr, char *buf) { - struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev); + struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev); ssize_t l = 0; 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) return l; } -CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); +DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); static struct class *osst_sysfs_class; @@ -5678,44 +5687,37 @@ static int osst_sysfs_init(void) static void osst_sysfs_destroy(dev_t dev) { - class_device_destroy(osst_sysfs_class, dev); + device_destroy(osst_sysfs_class, dev); } static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * STp, char * name) { - struct class_device *osst_class_member; + struct device *osst_member; int err; - osst_class_member = class_device_create(osst_sysfs_class, NULL, dev, - device, "%s", name); - if (IS_ERR(osst_class_member)) { + osst_member = device_create(osst_sysfs_class, device, dev, "%s", name); + if (IS_ERR(osst_member)) { printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); - return PTR_ERR(osst_class_member); + return PTR_ERR(osst_member); } - class_set_devdata(osst_class_member, STp); - err = class_device_create_file(osst_class_member, - &class_device_attr_ADR_rev); + dev_set_drvdata(osst_member, STp); + err = device_create_file(osst_member, &dev_attr_ADR_rev); if (err) goto err_out; - err = class_device_create_file(osst_class_member, - &class_device_attr_media_version); + err = device_create_file(osst_member, &dev_attr_media_version); if (err) goto err_out; - err = class_device_create_file(osst_class_member, - &class_device_attr_capacity); + err = device_create_file(osst_member, &dev_attr_capacity); if (err) goto err_out; - err = class_device_create_file(osst_class_member, - &class_device_attr_BOT_frame); + err = device_create_file(osst_member, &dev_attr_BOT_frame); if (err) goto err_out; - err = class_device_create_file(osst_class_member, - &class_device_attr_EOD_frame); + err = device_create_file(osst_member, &dev_attr_EOD_frame); if (err) goto err_out; - err = class_device_create_file(osst_class_member, - &class_device_attr_file_count); + err = device_create_file(osst_member, &dev_attr_file_count); if (err) goto err_out;