diff options
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/mptbase.h | 2 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 8 | ||||
-rw-r--r-- | drivers/message/i2o/driver.c | 26 |
3 files changed, 19 insertions, 17 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index d25d3be8fcd2..165f81d16d00 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -436,7 +436,7 @@ typedef struct _MPT_SAS_MGMT { | |||
436 | typedef struct _mpt_ioctl_events { | 436 | typedef struct _mpt_ioctl_events { |
437 | u32 event; /* Specified by define above */ | 437 | u32 event; /* Specified by define above */ |
438 | u32 eventContext; /* Index or counter */ | 438 | u32 eventContext; /* Index or counter */ |
439 | int data[2]; /* First 8 bytes of Event Data */ | 439 | u32 data[2]; /* First 8 bytes of Event Data */ |
440 | } MPT_IOCTL_EVENTS; | 440 | } MPT_IOCTL_EVENTS; |
441 | 441 | ||
442 | /* | 442 | /* |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 561074a04b03..bc740a6dd93c 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -2423,11 +2423,11 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR | |||
2423 | ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE; | 2423 | ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE; |
2424 | ioc->events[idx].eventContext = ioc->eventContext; | 2424 | ioc->events[idx].eventContext = ioc->eventContext; |
2425 | 2425 | ||
2426 | ioc->events[idx].data[0] = (pReq->LUN[1] << 24) || | 2426 | ioc->events[idx].data[0] = (pReq->LUN[1] << 24) | |
2427 | (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) || | 2427 | (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) | |
2428 | (sc->device->channel << 8) || sc->device->id; | 2428 | (sc->device->channel << 8) | sc->device->id; |
2429 | 2429 | ||
2430 | ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; | 2430 | ioc->events[idx].data[1] = (sense_data[13] << 8) | sense_data[12]; |
2431 | 2431 | ||
2432 | ioc->eventContext++; | 2432 | ioc->eventContext++; |
2433 | if (hd->ioc->pcidev->vendor == | 2433 | if (hd->ioc->pcidev->vendor == |
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index d3235f213c89..e0d474b17433 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c | |||
@@ -123,8 +123,12 @@ int i2o_driver_register(struct i2o_driver *drv) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | rc = driver_register(&drv->driver); | 125 | rc = driver_register(&drv->driver); |
126 | if (rc) | 126 | if (rc) { |
127 | destroy_workqueue(drv->event_queue); | 127 | if (drv->event) { |
128 | destroy_workqueue(drv->event_queue); | ||
129 | drv->event_queue = NULL; | ||
130 | } | ||
131 | } | ||
128 | 132 | ||
129 | return rc; | 133 | return rc; |
130 | }; | 134 | }; |
@@ -256,7 +260,7 @@ void i2o_driver_notify_controller_add_all(struct i2o_controller *c) | |||
256 | int i; | 260 | int i; |
257 | struct i2o_driver *drv; | 261 | struct i2o_driver *drv; |
258 | 262 | ||
259 | for (i = 0; i < I2O_MAX_DRIVERS; i++) { | 263 | for (i = 0; i < i2o_max_drivers; i++) { |
260 | drv = i2o_drivers[i]; | 264 | drv = i2o_drivers[i]; |
261 | 265 | ||
262 | if (drv) | 266 | if (drv) |
@@ -276,7 +280,7 @@ void i2o_driver_notify_controller_remove_all(struct i2o_controller *c) | |||
276 | int i; | 280 | int i; |
277 | struct i2o_driver *drv; | 281 | struct i2o_driver *drv; |
278 | 282 | ||
279 | for (i = 0; i < I2O_MAX_DRIVERS; i++) { | 283 | for (i = 0; i < i2o_max_drivers; i++) { |
280 | drv = i2o_drivers[i]; | 284 | drv = i2o_drivers[i]; |
281 | 285 | ||
282 | if (drv) | 286 | if (drv) |
@@ -295,7 +299,7 @@ void i2o_driver_notify_device_add_all(struct i2o_device *i2o_dev) | |||
295 | int i; | 299 | int i; |
296 | struct i2o_driver *drv; | 300 | struct i2o_driver *drv; |
297 | 301 | ||
298 | for (i = 0; i < I2O_MAX_DRIVERS; i++) { | 302 | for (i = 0; i < i2o_max_drivers; i++) { |
299 | drv = i2o_drivers[i]; | 303 | drv = i2o_drivers[i]; |
300 | 304 | ||
301 | if (drv) | 305 | if (drv) |
@@ -314,7 +318,7 @@ void i2o_driver_notify_device_remove_all(struct i2o_device *i2o_dev) | |||
314 | int i; | 318 | int i; |
315 | struct i2o_driver *drv; | 319 | struct i2o_driver *drv; |
316 | 320 | ||
317 | for (i = 0; i < I2O_MAX_DRIVERS; i++) { | 321 | for (i = 0; i < i2o_max_drivers; i++) { |
318 | drv = i2o_drivers[i]; | 322 | drv = i2o_drivers[i]; |
319 | 323 | ||
320 | if (drv) | 324 | if (drv) |
@@ -335,17 +339,15 @@ int __init i2o_driver_init(void) | |||
335 | 339 | ||
336 | spin_lock_init(&i2o_drivers_lock); | 340 | spin_lock_init(&i2o_drivers_lock); |
337 | 341 | ||
338 | if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) || | 342 | if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64)) { |
339 | ((i2o_max_drivers ^ (i2o_max_drivers - 1)) != | 343 | osm_warn("max_drivers set to %d, but must be >=2 and <= 64\n", |
340 | (2 * i2o_max_drivers - 1))) { | 344 | i2o_max_drivers); |
341 | osm_warn("max_drivers set to %d, but must be >=2 and <= 64 and " | ||
342 | "a power of 2\n", i2o_max_drivers); | ||
343 | i2o_max_drivers = I2O_MAX_DRIVERS; | 345 | i2o_max_drivers = I2O_MAX_DRIVERS; |
344 | } | 346 | } |
345 | osm_info("max drivers = %d\n", i2o_max_drivers); | 347 | osm_info("max drivers = %d\n", i2o_max_drivers); |
346 | 348 | ||
347 | i2o_drivers = | 349 | i2o_drivers = |
348 | kzalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); | 350 | kcalloc(i2o_max_drivers, sizeof(*i2o_drivers), GFP_KERNEL); |
349 | if (!i2o_drivers) | 351 | if (!i2o_drivers) |
350 | return -ENOMEM; | 352 | return -ENOMEM; |
351 | 353 | ||