aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/Kconfig2
-rw-r--r--block/bsg.c30
2 files changed, 1 insertions, 31 deletions
diff --git a/block/Kconfig b/block/Kconfig
index 0768741d6813..ca2ef4e08497 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -53,7 +53,7 @@ endif # BLOCK
53 53
54config BLK_DEV_BSG 54config BLK_DEV_BSG
55 bool "Block layer SG support v4 (EXPERIMENTAL)" 55 bool "Block layer SG support v4 (EXPERIMENTAL)"
56 depends on (SCSI=y) && EXPERIMENTAL 56 depends on EXPERIMENTAL
57 ---help--- 57 ---help---
58 Saying Y here will enable generic SG (SCSI generic) v4 support 58 Saying Y here will enable generic SG (SCSI generic) v4 support
59 for any block device. 59 for any block device.
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}
1010EXPORT_SYMBOL_GPL(bsg_register_queue); 1010EXPORT_SYMBOL_GPL(bsg_register_queue);
1011 1011
1012static 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
1025static 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
1030static struct class_interface bsg_intf = {
1031 .add = bsg_add,
1032 .remove = bsg_remove,
1033};
1034
1035static struct cdev bsg_cdev = { 1012static 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;
1079remove_cdev:
1080 printk(KERN_ERR "bsg: failed register scsi interface %d\n", ret);
1081 cdev_del(&bsg_cdev);
1082unregister_chrdev: 1052unregister_chrdev:
1083 unregister_chrdev_region(MKDEV(bsg_major, 0), BSG_MAX_DEVS); 1053 unregister_chrdev_region(MKDEV(bsg_major, 0), BSG_MAX_DEVS);
1084destroy_bsg_class: 1054destroy_bsg_class: