diff options
Diffstat (limited to 'block/bsg.c')
-rw-r--r-- | block/bsg.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/block/bsg.c b/block/bsg.c index baa04e7adf19..4e0be1b2e2a0 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -1009,29 +1009,6 @@ err: | |||
1009 | } | 1009 | } |
1010 | EXPORT_SYMBOL_GPL(bsg_register_queue); | 1010 | EXPORT_SYMBOL_GPL(bsg_register_queue); |
1011 | 1011 | ||
1012 | static int bsg_add(struct class_device *cl_dev, struct class_interface *cl_intf) | ||
1013 | { | ||
1014 | int ret; | ||
1015 | struct scsi_device *sdp = to_scsi_device(cl_dev->dev); | ||
1016 | struct request_queue *rq = sdp->request_queue; | ||
1017 | |||
1018 | if (rq->kobj.parent) | ||
1019 | ret = bsg_register_queue(rq, kobject_name(rq->kobj.parent)); | ||
1020 | else | ||
1021 | ret = bsg_register_queue(rq, kobject_name(&sdp->sdev_gendev.kobj)); | ||
1022 | return ret; | ||
1023 | } | ||
1024 | |||
1025 | static void bsg_remove(struct class_device *cl_dev, struct class_interface *cl_intf) | ||
1026 | { | ||
1027 | bsg_unregister_queue(to_scsi_device(cl_dev->dev)->request_queue); | ||
1028 | } | ||
1029 | |||
1030 | static struct class_interface bsg_intf = { | ||
1031 | .add = bsg_add, | ||
1032 | .remove = bsg_remove, | ||
1033 | }; | ||
1034 | |||
1035 | static struct cdev bsg_cdev = { | 1012 | static struct cdev bsg_cdev = { |
1036 | .kobj = {.name = "bsg", }, | 1013 | .kobj = {.name = "bsg", }, |
1037 | .owner = THIS_MODULE, | 1014 | .owner = THIS_MODULE, |
@@ -1069,16 +1046,9 @@ static int __init bsg_init(void) | |||
1069 | if (ret) | 1046 | if (ret) |
1070 | goto unregister_chrdev; | 1047 | goto unregister_chrdev; |
1071 | 1048 | ||
1072 | ret = scsi_register_interface(&bsg_intf); | ||
1073 | if (ret) | ||
1074 | goto remove_cdev; | ||
1075 | |||
1076 | printk(KERN_INFO BSG_DESCRIPTION " version " BSG_VERSION | 1049 | printk(KERN_INFO BSG_DESCRIPTION " version " BSG_VERSION |
1077 | " loaded (major %d)\n", bsg_major); | 1050 | " loaded (major %d)\n", bsg_major); |
1078 | return 0; | 1051 | return 0; |
1079 | remove_cdev: | ||
1080 | printk(KERN_ERR "bsg: failed register scsi interface %d\n", ret); | ||
1081 | cdev_del(&bsg_cdev); | ||
1082 | unregister_chrdev: | 1052 | unregister_chrdev: |
1083 | unregister_chrdev_region(MKDEV(bsg_major, 0), BSG_MAX_DEVS); | 1053 | unregister_chrdev_region(MKDEV(bsg_major, 0), BSG_MAX_DEVS); |
1084 | destroy_bsg_class: | 1054 | destroy_bsg_class: |