Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2051
b: refs/heads/master
c: 21feb5c
h: refs/heads/master
i:
  2049: 07fc75b
  2047: e100904
v: v3
  • Loading branch information
Gerd Knorr authored and James Bottomley committed May 20, 2005
1 parent cb4b1f3 commit b3af2e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: daa6eda65a53e5addf86c6bc829129ff51b08bda
refs/heads/master: 21feb5ccd5d054b8a17fe86b1b5df1e16809df64
17 changes: 9 additions & 8 deletions trunk/drivers/scsi/ch.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static long ch_ioctl_compat(struct file * filp,
unsigned int cmd, unsigned long arg);
#endif

static struct class_simple * ch_sysfs_class;
static struct class * ch_sysfs_class;

typedef struct {
struct list_head list;
Expand Down Expand Up @@ -942,9 +942,9 @@ static int ch_probe(struct device *dev)

devfs_mk_cdev(MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
S_IFCHR | S_IRUGO | S_IWUGO, ch->name);
class_simple_device_add(ch_sysfs_class,
MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
dev, "s%s", ch->name);
class_device_create(ch_sysfs_class,
MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
dev, "s%s", ch->name);

printk(KERN_INFO "Attached scsi changer %s "
"at scsi%d, channel %d, id %d, lun %d\n",
Expand Down Expand Up @@ -972,7 +972,8 @@ static int ch_remove(struct device *dev)
list_del(&ch->list);
spin_unlock(&ch_devlist_lock);

class_simple_device_remove(MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
class_device_destroy(ch_sysfs_class,
MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
devfs_remove(ch->name);
kfree(ch->dt);
kfree(ch);
Expand All @@ -985,7 +986,7 @@ static int __init init_ch_module(void)
int rc;

printk(KERN_INFO "SCSI Media Changer driver v" VERSION " \n");
ch_sysfs_class = class_simple_create(THIS_MODULE, "scsi_changer");
ch_sysfs_class = class_create(THIS_MODULE, "scsi_changer");
if (IS_ERR(ch_sysfs_class)) {
rc = PTR_ERR(ch_sysfs_class);
return rc;
Expand All @@ -1004,15 +1005,15 @@ static int __init init_ch_module(void)
fail2:
unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
fail1:
class_simple_destroy(ch_sysfs_class);
class_destroy(ch_sysfs_class);
return rc;
}

static void __exit exit_ch_module(void)
{
scsi_unregister_driver(&ch_template.gendrv);
unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
class_simple_destroy(ch_sysfs_class);
class_destroy(ch_sysfs_class);
}

module_init(init_ch_module);
Expand Down

0 comments on commit b3af2e5

Please sign in to comment.