diff options
Diffstat (limited to 'drivers/message/i2o/driver.c')
| -rw-r--r-- | drivers/message/i2o/driver.c | 12 | 
1 files changed, 4 insertions, 8 deletions
| diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index 0fb9c4e2ad4c..64130227574f 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c | |||
| @@ -61,12 +61,10 @@ static int i2o_bus_match(struct device *dev, struct device_driver *drv) | |||
| 61 | }; | 61 | }; | 
| 62 | 62 | ||
| 63 | /* I2O bus type */ | 63 | /* I2O bus type */ | 
| 64 | extern struct device_attribute i2o_device_attrs[]; | ||
| 65 | |||
| 66 | struct bus_type i2o_bus_type = { | 64 | struct bus_type i2o_bus_type = { | 
| 67 | .name = "i2o", | 65 | .name = "i2o", | 
| 68 | .match = i2o_bus_match, | 66 | .match = i2o_bus_match, | 
| 69 | .dev_attrs = i2o_device_attrs, | 67 | .dev_attrs = i2o_device_attrs | 
| 70 | }; | 68 | }; | 
| 71 | 69 | ||
| 72 | /** | 70 | /** | 
| @@ -219,14 +217,14 @@ int i2o_driver_dispatch(struct i2o_controller *c, u32 m) | |||
| 219 | /* cut of header from message size (in 32-bit words) */ | 217 | /* cut of header from message size (in 32-bit words) */ | 
| 220 | size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5; | 218 | size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5; | 
| 221 | 219 | ||
| 222 | evt = kmalloc(size * 4 + sizeof(*evt), GFP_ATOMIC | __GFP_ZERO); | 220 | evt = kzalloc(size * 4 + sizeof(*evt), GFP_ATOMIC); | 
| 223 | if (!evt) | 221 | if (!evt) | 
| 224 | return -ENOMEM; | 222 | return -ENOMEM; | 
| 225 | 223 | ||
| 226 | evt->size = size; | 224 | evt->size = size; | 
| 227 | evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt); | 225 | evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt); | 
| 228 | evt->event_indicator = le32_to_cpu(msg->body[0]); | 226 | evt->event_indicator = le32_to_cpu(msg->body[0]); | 
| 229 | memcpy(&evt->tcntxt, &msg->u.s.tcntxt, size * 4); | 227 | memcpy(&evt->data, &msg->body[1], size * 4); | 
| 230 | 228 | ||
| 231 | list_for_each_entry_safe(dev, tmp, &c->devices, list) | 229 | list_for_each_entry_safe(dev, tmp, &c->devices, list) | 
| 232 | if (dev->lct_data.tid == tid) { | 230 | if (dev->lct_data.tid == tid) { | 
| @@ -349,12 +347,10 @@ int __init i2o_driver_init(void) | |||
| 349 | osm_info("max drivers = %d\n", i2o_max_drivers); | 347 | osm_info("max drivers = %d\n", i2o_max_drivers); | 
| 350 | 348 | ||
| 351 | i2o_drivers = | 349 | i2o_drivers = | 
| 352 | kmalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); | 350 | kzalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); | 
| 353 | if (!i2o_drivers) | 351 | if (!i2o_drivers) | 
| 354 | return -ENOMEM; | 352 | return -ENOMEM; | 
| 355 | 353 | ||
| 356 | memset(i2o_drivers, 0, i2o_max_drivers * sizeof(*i2o_drivers)); | ||
| 357 | |||
| 358 | rc = bus_register(&i2o_bus_type); | 354 | rc = bus_register(&i2o_bus_type); | 
| 359 | 355 | ||
| 360 | if (rc < 0) | 356 | if (rc < 0) | 
