Commit e7f0ba55 authored by Kai Mäkisara's avatar Kai Mäkisara Committed by James Bottomley

[PATCH] Fix SCSI + st regressions problem

remove dependency on kobj.name.
parent 72a3b209
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
*/ */
static char *verstr = "20040226"; static char *verstr = "20040318";
#include <linux/module.h> #include <linux/module.h>
...@@ -4193,20 +4193,25 @@ CLASS_DEVICE_ATTR(default_compression, S_IRUGO, st_defcompression_show, NULL); ...@@ -4193,20 +4193,25 @@ CLASS_DEVICE_ATTR(default_compression, S_IRUGO, st_defcompression_show, NULL);
static void do_create_class_files(Scsi_Tape *STp, int dev_num, int mode) static void do_create_class_files(Scsi_Tape *STp, int dev_num, int mode)
{ {
int rew, error; int i, rew, error;
char name[10];
struct class_device *st_class_member; struct class_device *st_class_member;
if (!st_sysfs_class) if (!st_sysfs_class)
return; return;
for (rew=0; rew < 2; rew++) { for (rew=0; rew < 2; rew++) {
/* Make sure that the minor numbers corresponding to the four
first modes always get the same names */
i = mode << (4 - ST_NBR_MODE_BITS);
snprintf(name, 10, "%s%s%s", rew ? "n" : "",
STp->disk->disk_name, st_formats[i]);
st_class_member = st_class_member =
class_simple_device_add(st_sysfs_class, class_simple_device_add(st_sysfs_class,
MKDEV(SCSI_TAPE_MAJOR, MKDEV(SCSI_TAPE_MAJOR,
TAPE_MINOR(dev_num, mode, rew)), TAPE_MINOR(dev_num, mode, rew)),
&STp->device->sdev_gendev, "%s", &STp->device->sdev_gendev, "%s", name);
STp->modes[mode].cdevs[rew]->kobj.name); if (IS_ERR(st_class_member)) {
if (!st_class_member) {
printk(KERN_WARNING "st%d: class_simple_device_add failed\n", printk(KERN_WARNING "st%d: class_simple_device_add failed\n",
dev_num); dev_num);
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment