aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-18 01:05:35 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:30 -0500
commit52840bd628707979b5bbcce3c506786d3a69dba0 (patch)
tree15c9b60fa5884e62706fd86defec2ab749a24bfa
parent542eb75a27616bdde95c8d3764e0ab703579f8b5 (diff)
Kobject: the cris iop_fw_load.c code is broken
This code is really really really broken. So much so that it's almost impossible to fix with a simple patch, so just comment out the offending registration with the kobject core, and mark the driver as broken. The problem is that the code is trying to register a "raw" struct device, which is not allowed. struct device is only for use within the driver model. This is being done to try to use the firmware layer which wants a struct device. To properly fix this, use something easy, like a platform device, which is a struct device and can be used for this kind of thing. Cc: Mikael Starvik <starvik@axis.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/cris/arch-v32/drivers/iop_fw_load.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/cris/arch-v32/drivers/iop_fw_load.c b/arch/cris/arch-v32/drivers/iop_fw_load.c
index 11f9895ded50..f4bdc1dfa320 100644
--- a/arch/cris/arch-v32/drivers/iop_fw_load.c
+++ b/arch/cris/arch-v32/drivers/iop_fw_load.c
@@ -20,6 +20,9 @@
20 20
21#define IOP_TIMEOUT 100 21#define IOP_TIMEOUT 100
22 22
23#error "This driver is broken with regard to its driver core usage."
24#error "Please contact <greg@kroah.com> for details on how to fix it properly."
25
23static struct device iop_spu_device[2] = { 26static struct device iop_spu_device[2] = {
24 { .bus_id = "iop-spu0", }, 27 { .bus_id = "iop-spu0", },
25 { .bus_id = "iop-spu1", }, 28 { .bus_id = "iop-spu1", },
@@ -192,6 +195,13 @@ int iop_start_mpu(unsigned int start_addr)
192 195
193static int __init iop_fw_load_init(void) 196static int __init iop_fw_load_init(void)
194{ 197{
198#if 0
199 /*
200 * static struct devices can not be added directly to sysfs by ignoring
201 * the driver model infrastructure. To fix this properly, please use
202 * the platform_bus to register these devices to be able to properly
203 * use the firmware infrastructure.
204 */
195 device_initialize(&iop_spu_device[0]); 205 device_initialize(&iop_spu_device[0]);
196 kobject_set_name(&iop_spu_device[0].kobj, "iop-spu0"); 206 kobject_set_name(&iop_spu_device[0].kobj, "iop-spu0");
197 kobject_add(&iop_spu_device[0].kobj); 207 kobject_add(&iop_spu_device[0].kobj);
@@ -201,6 +211,7 @@ static int __init iop_fw_load_init(void)
201 device_initialize(&iop_mpu_device); 211 device_initialize(&iop_mpu_device);
202 kobject_set_name(&iop_mpu_device.kobj, "iop-mpu"); 212 kobject_set_name(&iop_mpu_device.kobj, "iop-mpu");
203 kobject_add(&iop_mpu_device.kobj); 213 kobject_add(&iop_mpu_device.kobj);
214#endif
204 return 0; 215 return 0;
205} 216}
206 217