diff options
author | James Bottomley <James.Bottomley@suse.de> | 2010-03-03 00:36:56 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-03 10:47:06 -0500 |
commit | fac829fdcaf451a20106cbc468ff886466320956 (patch) | |
tree | 8fd1efcabda65db1abd0bb385367bf3f8389e4db /drivers/scsi | |
parent | 98e1e0f07c3f1820b8ac424569ee9e9916d3665b (diff) |
[SCSI] raid_attrs: fix dependency problems
RAID attributes uses scsi_is_sdev_device() to gate some SCSI specific
checking code. This causes two problems. Firstly if SCSI == n just
defining scsi_is_sdev_device() to return false might not be enough to
prevent gcc from emitting the code (and thus referring to undefined
symbols), so this needs surrounding with an ifdef. Secondly, using
scsi_is_sdev_device() when SCSI is either y or m gives a subtle
problem in the m case: raid_attrs must also be m to use the symbol.
Do the usual Kconfig jiggery-pokery to fix this.
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/Kconfig | 6 | ||||
-rw-r--r-- | drivers/scsi/raid_class.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 9191d1ea6451..75f2336807cb 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -1,9 +1,15 @@ | |||
1 | menu "SCSI device support" | 1 | menu "SCSI device support" |
2 | 2 | ||
3 | config SCSI_MOD | ||
4 | tristate | ||
5 | default y if SCSI=n || SCSI=y | ||
6 | default m if SCSI=m | ||
7 | |||
3 | config RAID_ATTRS | 8 | config RAID_ATTRS |
4 | tristate "RAID Transport Class" | 9 | tristate "RAID Transport Class" |
5 | default n | 10 | default n |
6 | depends on BLOCK | 11 | depends on BLOCK |
12 | depends on SCSI_MOD | ||
7 | ---help--- | 13 | ---help--- |
8 | Provides RAID | 14 | Provides RAID |
9 | 15 | ||
diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c index bd88349b8526..2c146b44d95f 100644 --- a/drivers/scsi/raid_class.c +++ b/drivers/scsi/raid_class.c | |||
@@ -63,6 +63,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev) | |||
63 | * emulated RAID devices, so start with SCSI */ | 63 | * emulated RAID devices, so start with SCSI */ |
64 | struct raid_internal *i = ac_to_raid_internal(cont); | 64 | struct raid_internal *i = ac_to_raid_internal(cont); |
65 | 65 | ||
66 | #if defined(CONFIG_SCSI) || defined(CONFIG_SCSI_MODULE) | ||
66 | if (scsi_is_sdev_device(dev)) { | 67 | if (scsi_is_sdev_device(dev)) { |
67 | struct scsi_device *sdev = to_scsi_device(dev); | 68 | struct scsi_device *sdev = to_scsi_device(dev); |
68 | 69 | ||
@@ -71,6 +72,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev) | |||
71 | 72 | ||
72 | return i->f->is_raid(dev); | 73 | return i->f->is_raid(dev); |
73 | } | 74 | } |
75 | #endif | ||
74 | /* FIXME: look at other subsystems too */ | 76 | /* FIXME: look at other subsystems too */ |
75 | return 0; | 77 | return 0; |
76 | } | 78 | } |