From 4f5ca09e0b854a29b17401f59487664ae3b21aa4 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 15 Sep 2005 02:01:32 -0500 Subject: [PATCH] I2O: remove class interface I2O: remove i2o_device_class_interface misuse The intent of class interfaces was to provide different 'views' at the same object, not just run some code every time a new class device is registered. Kill interface structure, make class core register default attributes and set up sysfs links right when registering class devices. Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/message/i2o/device.c | 255 +++++++++++++++++++++---------------------- 1 file changed, 122 insertions(+), 133 deletions(-) (limited to 'drivers/message/i2o') diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index 21f16ba3ac3..551d582e288 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c @@ -45,10 +45,10 @@ static inline int i2o_device_issue_claim(struct i2o_device *dev, u32 cmd, writel(type, &msg->body[0]); return i2o_msg_post_wait(dev->iop, m, 60); -}; +} /** - * i2o_device_claim - claim a device for use by an OSM + * i2o_device_claim - claim a device for use by an OSM * @dev: I2O device to claim * @drv: I2O driver which wants to claim the device * @@ -73,7 +73,7 @@ int i2o_device_claim(struct i2o_device *dev) up(&dev->lock); return rc; -}; +} /** * i2o_device_claim_release - release a device that the OSM is using @@ -119,7 +119,8 @@ int i2o_device_claim_release(struct i2o_device *dev) up(&dev->lock); return rc; -}; +} + /** * i2o_device_release - release the memory for a I2O device @@ -135,39 +136,62 @@ static void i2o_device_release(struct device *dev) pr_debug("i2o: device %s released\n", dev->bus_id); kfree(i2o_dev); -}; +} /** - * i2o_device_class_release - Remove I2O device attributes + * i2o_device_class_release - I2O class device release function * @cd: I2O class device which is added to the I2O device class * - * Removes attributes from the I2O device again. Also search each device - * on the controller for I2O devices which refert to this device as parent - * or user and remove this links also. + * The function is just a stub - memory will be freed when + * associated I2O device is released. */ static void i2o_device_class_release(struct class_device *cd) { - struct i2o_device *i2o_dev, *tmp; - struct i2o_controller *c; + /* empty */ +} - i2o_dev = to_i2o_device(cd->dev); - c = i2o_dev->iop; +/** + * i2o_device_class_show_class_id - Displays class id of I2O device + * @cd: class device of which the class id should be displayed + * @buf: buffer into which the class id should be printed + * + * Returns the number of bytes which are printed into the buffer. + */ +static ssize_t i2o_device_class_show_class_id(struct class_device *cd, + char *buf) +{ + struct i2o_device *dev = to_i2o_device(cd->dev); - sysfs_remove_link(&i2o_dev->device.kobj, "parent"); - sysfs_remove_link(&i2o_dev->device.kobj, "user"); + sprintf(buf, "0x%03x\n", dev->lct_data.class_id); + return strlen(buf) + 1; +} - list_for_each_entry(tmp, &c->devices, list) { - if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) - sysfs_remove_link(&tmp->device.kobj, "parent"); - if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid) - sysfs_remove_link(&tmp->device.kobj, "user"); - } +/** + * i2o_device_class_show_tid - Displays TID of I2O device + * @cd: class device of which the TID should be displayed + * @buf: buffer into which the class id should be printed + * + * Returns the number of bytes which are printed into the buffer. + */ +static ssize_t i2o_device_class_show_tid(struct class_device *cd, char *buf) +{ + struct i2o_device *dev = to_i2o_device(cd->dev); + + sprintf(buf, "0x%03x\n", dev->lct_data.tid); + return strlen(buf) + 1; +} + +static struct class_device_attribute i2o_device_class_attrs[] = { + __ATTR(class_id, S_IRUGO, i2o_device_class_show_class_id, NULL), + __ATTR(tid, S_IRUGO, i2o_device_class_show_tid, NULL), + __ATTR_NULL }; /* I2O device class */ static struct class i2o_device_class = { - .name = "i2o_device", - .release = i2o_device_class_release + .name = "i2o_device", + .release = i2o_device_class_release, + .class_dev_attrs = i2o_device_class_attrs, }; /** @@ -197,7 +221,67 @@ static struct i2o_device *i2o_device_alloc(void) dev->classdev.dev = &dev->device; return dev; -}; +} + +/** + * i2o_setup_sysfs_links - Adds attributes to the I2O device + * @cd: I2O class device which is added to the I2O device class + * + * This function get called when a I2O device is added to the class. It + * creates the attributes for each device and creates user/parent symlink + * if necessary. + * + * Returns 0 on success or negative error code on failure. + */ +static void i2o_setup_sysfs_links(struct i2o_device *i2o_dev) +{ + struct i2o_controller *c = i2o_dev->iop; + struct i2o_device *tmp; + + /* create user entries for this device */ + tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.user_tid); + if (tmp && tmp != i2o_dev) + sysfs_create_link(&i2o_dev->device.kobj, + &tmp->device.kobj, "user"); + + /* create user entries refering to this device */ + list_for_each_entry(tmp, &c->devices, list) + if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid && + tmp != i2o_dev) + sysfs_create_link(&tmp->device.kobj, + &i2o_dev->device.kobj, "user"); + + /* create parent entries for this device */ + tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.parent_tid); + if (tmp && tmp != i2o_dev) + sysfs_create_link(&i2o_dev->device.kobj, + &tmp->device.kobj, "parent"); + + /* create parent entries refering to this device */ + list_for_each_entry(tmp, &c->devices, list) + if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid && + tmp != i2o_dev) + sysfs_create_link(&tmp->device.kobj, + &i2o_dev->device.kobj, "parent"); +} + +static void i2o_remove_sysfs_links(struct i2o_device *i2o_dev) +{ + struct i2o_controller *c = i2o_dev->iop; + struct i2o_device *tmp; + + sysfs_remove_link(&i2o_dev->device.kobj, "parent"); + sysfs_remove_link(&i2o_dev->device.kobj, "user"); + + list_for_each_entry(tmp, &c->devices, list) { + if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) + sysfs_remove_link(&tmp->device.kobj, "parent"); + if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid) + sysfs_remove_link(&tmp->device.kobj, "user"); + } +} + + /** * i2o_device_add - allocate a new I2O device and add it to the IOP @@ -222,6 +306,7 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c, } dev->lct_data = *entry; + dev->iop = c; snprintf(dev->device.bus_id, BUS_ID_SIZE, "%d:%03x", c->unit, dev->lct_data.tid); @@ -229,7 +314,6 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c, snprintf(dev->classdev.class_id, BUS_ID_SIZE, "%d:%03x", c->unit, dev->lct_data.tid); - dev->iop = c; dev->device.parent = &c->device; device_register(&dev->device); @@ -238,12 +322,14 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c, class_device_register(&dev->classdev); + i2o_setup_sysfs_links(dev); + i2o_driver_notify_device_add_all(dev); pr_debug("i2o: device %s added\n", dev->device.bus_id); return dev; -}; +} /** * i2o_device_remove - remove an I2O device from the I2O core @@ -256,10 +342,11 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c, void i2o_device_remove(struct i2o_device *i2o_dev) { i2o_driver_notify_device_remove_all(i2o_dev); + i2o_remove_sysfs_links(i2o_dev); class_device_unregister(&i2o_dev->classdev); list_del(&i2o_dev->list); device_unregister(&i2o_dev->device); -}; +} /** * i2o_device_parse_lct - Parse a previously fetched LCT and create devices @@ -337,99 +424,8 @@ int i2o_device_parse_lct(struct i2o_controller *c) up(&c->lct_lock); return 0; -}; - -/** - * i2o_device_class_show_class_id - Displays class id of I2O device - * @cd: class device of which the class id should be displayed - * @buf: buffer into which the class id should be printed - * - * Returns the number of bytes which are printed into the buffer. - */ -static ssize_t i2o_device_class_show_class_id(struct class_device *cd, - char *buf) -{ - struct i2o_device *dev = to_i2o_device(cd->dev); - - sprintf(buf, "0x%03x\n", dev->lct_data.class_id); - return strlen(buf) + 1; -}; - -/** - * i2o_device_class_show_tid - Displays TID of I2O device - * @cd: class device of which the TID should be displayed - * @buf: buffer into which the class id should be printed - * - * Returns the number of bytes which are printed into the buffer. - */ -static ssize_t i2o_device_class_show_tid(struct class_device *cd, char *buf) -{ - struct i2o_device *dev = to_i2o_device(cd->dev); - - sprintf(buf, "0x%03x\n", dev->lct_data.tid); - return strlen(buf) + 1; -}; - -/* I2O device class attributes */ -static CLASS_DEVICE_ATTR(class_id, S_IRUGO, i2o_device_class_show_class_id, - NULL); -static CLASS_DEVICE_ATTR(tid, S_IRUGO, i2o_device_class_show_tid, NULL); - -/** - * i2o_device_class_add - Adds attributes to the I2O device - * @cd: I2O class device which is added to the I2O device class - * - * This function get called when a I2O device is added to the class. It - * creates the attributes for each device and creates user/parent symlink - * if necessary. - * - * Returns 0 on success or negative error code on failure. - */ -static int i2o_device_class_add(struct class_device *cd) -{ - struct i2o_device *i2o_dev, *tmp; - struct i2o_controller *c; - - i2o_dev = to_i2o_device(cd->dev); - c = i2o_dev->iop; - - class_device_create_file(cd, &class_device_attr_class_id); - class_device_create_file(cd, &class_device_attr_tid); - - /* create user entries for this device */ - tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.user_tid); - if (tmp && (tmp != i2o_dev)) - sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, - "user"); - - /* create user entries refering to this device */ - list_for_each_entry(tmp, &c->devices, list) - if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid) - && (tmp != i2o_dev)) - sysfs_create_link(&tmp->device.kobj, - &i2o_dev->device.kobj, "user"); - - /* create parent entries for this device */ - tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.parent_tid); - if (tmp && (tmp != i2o_dev)) - sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, - "parent"); - - /* create parent entries refering to this device */ - list_for_each_entry(tmp, &c->devices, list) - if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) - && (tmp != i2o_dev)) - sysfs_create_link(&tmp->device.kobj, - &i2o_dev->device.kobj, "parent"); - - return 0; -}; +} -/* I2O device class interface */ -static struct class_interface i2o_device_class_interface = { - .class = &i2o_device_class, - .add = i2o_device_class_add -}; /* * Run time support routines @@ -553,11 +549,11 @@ int i2o_parm_field_get(struct i2o_device *i2o_dev, int group, int field, } /* - * if oper == I2O_PARAMS_TABLE_GET, get from all rows - * if fieldcount == -1 return all fields + * if oper == I2O_PARAMS_TABLE_GET, get from all rows + * if fieldcount == -1 return all fields * ibuf and ibuflen are unused (use NULL, 0) - * else return specific fields - * ibuf contains fieldindexes + * else return specific fields + * ibuf contains fieldindexes * * if oper == I2O_PARAMS_LIST_GET, get from specific rows * if fieldcount == -1 return all fields @@ -611,14 +607,8 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group, */ int i2o_device_init(void) { - int rc; - - rc = class_register(&i2o_device_class); - if (rc) - return rc; - - return class_interface_register(&i2o_device_class_interface); -}; + return class_register(&i2o_device_class); +} /** * i2o_device_exit - I2O devices exit function @@ -627,9 +617,8 @@ int i2o_device_init(void) */ void i2o_device_exit(void) { - class_interface_register(&i2o_device_class_interface); class_unregister(&i2o_device_class); -}; +} EXPORT_SYMBOL(i2o_device_claim); EXPORT_SYMBOL(i2o_device_claim_release); -- cgit v1.2.3 From 607cf4d9aa1d766890f42fc892d39d48cf6d6c16 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 27 Oct 2005 22:25:43 -0700 Subject: [PATCH] I2O: Clean up some pretty bad driver model abuses in the i2o code Signed-off-by: Greg Kroah-Hartman --- drivers/message/i2o/iop.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'drivers/message/i2o') diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 42f8b810d6e..15deb45ce99 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c @@ -833,6 +833,7 @@ void i2o_iop_remove(struct i2o_controller *c) list_for_each_entry_safe(dev, tmp, &c->devices, list) i2o_device_remove(dev); + class_device_unregister(c->classdev); device_del(&c->device); /* Ask the IOP to switch to RESET state */ @@ -1077,9 +1078,7 @@ static void i2o_iop_release(struct device *dev) }; /* I2O controller class */ -static struct class i2o_controller_class = { - .name = "i2o_controller", -}; +static struct class *i2o_controller_class; /** * i2o_iop_alloc - Allocate and initialize a i2o_controller struct @@ -1110,14 +1109,10 @@ struct i2o_controller *i2o_iop_alloc(void) sprintf(c->name, "iop%d", c->unit); device_initialize(&c->device); - class_device_initialize(&c->classdev); c->device.release = &i2o_iop_release; - c->classdev.class = &i2o_controller_class; - c->classdev.dev = &c->device; snprintf(c->device.bus_id, BUS_ID_SIZE, "iop%d", c->unit); - snprintf(c->classdev.class_id, BUS_ID_SIZE, "iop%d", c->unit); #if BITS_PER_LONG == 64 spin_lock_init(&c->context_list_lock); @@ -1146,7 +1141,9 @@ int i2o_iop_add(struct i2o_controller *c) goto iop_reset; } - if ((rc = class_device_add(&c->classdev))) { + c->classdev = class_device_create(i2o_controller_class, 0, + &c->device, "iop%d", c->unit); + if (IS_ERR(c->classdev)) { osm_err("%s: could not add controller class\n", c->name); goto device_del; } @@ -1184,7 +1181,7 @@ int i2o_iop_add(struct i2o_controller *c) return 0; class_del: - class_device_del(&c->classdev); + class_device_unregister(c->classdev); device_del: device_del(&c->device); @@ -1250,7 +1247,8 @@ static int __init i2o_iop_init(void) if (rc) goto exit; - if ((rc = class_register(&i2o_controller_class))) { + i2o_controller_class = class_create(THIS_MODULE, "i2o_controller"); + if (IS_ERR(i2o_controller_class)) { osm_err("can't register class i2o_controller\n"); goto device_exit; } @@ -1273,7 +1271,7 @@ static int __init i2o_iop_init(void) i2o_driver_exit(); class_exit: - class_unregister(&i2o_controller_class); + class_destroy(i2o_controller_class); device_exit: i2o_device_exit(); @@ -1292,7 +1290,7 @@ static void __exit i2o_iop_exit(void) i2o_pci_exit(); i2o_exec_exit(); i2o_driver_exit(); - class_unregister(&i2o_controller_class); + class_destroy(i2o_controller_class); i2o_device_exit(); }; -- cgit v1.2.3 From 7bd7b091429705eb281d60c553cc643aada8045a Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 29 Sep 2005 00:40:07 -0500 Subject: [PATCH] I2O: remove i2o_device_class I2O: cleanup - remove i2o_device_class I2O devices reside on their own bus so there should be no reason to also have i2c_device class that mirros i2o bus. Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/message/i2o/core.h | 3 -- drivers/message/i2o/device.c | 71 ++++++++------------------------------------ drivers/message/i2o/driver.c | 3 ++ drivers/message/i2o/iop.c | 10 +------ 4 files changed, 17 insertions(+), 70 deletions(-) (limited to 'drivers/message/i2o') diff --git a/drivers/message/i2o/core.h b/drivers/message/i2o/core.h index c5bcfd70f71..9eefedb1621 100644 --- a/drivers/message/i2o/core.h +++ b/drivers/message/i2o/core.h @@ -36,9 +36,6 @@ extern void __exit i2o_pci_exit(void); extern void i2o_device_remove(struct i2o_device *); extern int i2o_device_parse_lct(struct i2o_controller *); -extern int i2o_device_init(void); -extern void i2o_device_exit(void); - /* IOP */ extern struct i2o_controller *i2o_iop_alloc(void); extern void i2o_iop_free(struct i2o_controller *); diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index 551d582e288..d9879965eb5 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c @@ -138,17 +138,6 @@ static void i2o_device_release(struct device *dev) kfree(i2o_dev); } -/** - * i2o_device_class_release - I2O class device release function - * @cd: I2O class device which is added to the I2O device class - * - * The function is just a stub - memory will be freed when - * associated I2O device is released. - */ -static void i2o_device_class_release(struct class_device *cd) -{ - /* empty */ -} /** * i2o_device_class_show_class_id - Displays class id of I2O device @@ -157,12 +146,13 @@ static void i2o_device_class_release(struct class_device *cd) * * Returns the number of bytes which are printed into the buffer. */ -static ssize_t i2o_device_class_show_class_id(struct class_device *cd, - char *buf) +static ssize_t i2o_device_show_class_id(struct device *dev, + struct device_attribute *attr, + char *buf) { - struct i2o_device *dev = to_i2o_device(cd->dev); + struct i2o_device *i2o_dev = to_i2o_device(dev); - sprintf(buf, "0x%03x\n", dev->lct_data.class_id); + sprintf(buf, "0x%03x\n", i2o_dev->lct_data.class_id); return strlen(buf) + 1; } @@ -173,27 +163,22 @@ static ssize_t i2o_device_class_show_class_id(struct class_device *cd, * * Returns the number of bytes which are printed into the buffer. */ -static ssize_t i2o_device_class_show_tid(struct class_device *cd, char *buf) +static ssize_t i2o_device_show_tid(struct device *dev, + struct device_attribute *attr, + char *buf) { - struct i2o_device *dev = to_i2o_device(cd->dev); + struct i2o_device *i2o_dev = to_i2o_device(dev); - sprintf(buf, "0x%03x\n", dev->lct_data.tid); + sprintf(buf, "0x%03x\n", i2o_dev->lct_data.tid); return strlen(buf) + 1; } -static struct class_device_attribute i2o_device_class_attrs[] = { - __ATTR(class_id, S_IRUGO, i2o_device_class_show_class_id, NULL), - __ATTR(tid, S_IRUGO, i2o_device_class_show_tid, NULL), +struct device_attribute i2o_device_attrs[] = { + __ATTR(class_id, S_IRUGO, i2o_device_show_class_id, NULL), + __ATTR(tid, S_IRUGO, i2o_device_show_tid, NULL), __ATTR_NULL }; -/* I2O device class */ -static struct class i2o_device_class = { - .name = "i2o_device", - .release = i2o_device_class_release, - .class_dev_attrs = i2o_device_class_attrs, -}; - /** * i2o_device_alloc - Allocate a I2O device and initialize it * @@ -217,8 +202,6 @@ static struct i2o_device *i2o_device_alloc(void) dev->device.bus = &i2o_bus_type; dev->device.release = &i2o_device_release; - dev->classdev.class = &i2o_device_class; - dev->classdev.dev = &dev->device; return dev; } @@ -311,17 +294,12 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c, snprintf(dev->device.bus_id, BUS_ID_SIZE, "%d:%03x", c->unit, dev->lct_data.tid); - snprintf(dev->classdev.class_id, BUS_ID_SIZE, "%d:%03x", c->unit, - dev->lct_data.tid); - dev->device.parent = &c->device; device_register(&dev->device); list_add_tail(&dev->list, &c->devices); - class_device_register(&dev->classdev); - i2o_setup_sysfs_links(dev); i2o_driver_notify_device_add_all(dev); @@ -343,7 +321,6 @@ void i2o_device_remove(struct i2o_device *i2o_dev) { i2o_driver_notify_device_remove_all(i2o_dev); i2o_remove_sysfs_links(i2o_dev); - class_device_unregister(&i2o_dev->classdev); list_del(&i2o_dev->list); device_unregister(&i2o_dev->device); } @@ -598,28 +575,6 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group, return size; } -/** - * i2o_device_init - Initialize I2O devices - * - * Registers the I2O device class. - * - * Returns 0 on success or negative error code on failure. - */ -int i2o_device_init(void) -{ - return class_register(&i2o_device_class); -} - -/** - * i2o_device_exit - I2O devices exit function - * - * Unregisters the I2O device class. - */ -void i2o_device_exit(void) -{ - class_unregister(&i2o_device_class); -} - EXPORT_SYMBOL(i2o_device_claim); EXPORT_SYMBOL(i2o_device_claim_release); EXPORT_SYMBOL(i2o_parm_field_get); diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index 739bfdef0c6..0079a4be0af 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c @@ -58,9 +58,12 @@ static int i2o_bus_match(struct device *dev, struct device_driver *drv) }; /* I2O bus type */ +extern struct device_attribute i2o_device_attrs[]; + struct bus_type i2o_bus_type = { .name = "i2o", .match = i2o_bus_match, + .dev_attrs = i2o_device_attrs, }; /** diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 15deb45ce99..176fb573ea2 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c @@ -1243,14 +1243,10 @@ static int __init i2o_iop_init(void) printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n"); - rc = i2o_device_init(); - if (rc) - goto exit; - i2o_controller_class = class_create(THIS_MODULE, "i2o_controller"); if (IS_ERR(i2o_controller_class)) { osm_err("can't register class i2o_controller\n"); - goto device_exit; + goto exit; } if ((rc = i2o_driver_init())) @@ -1273,9 +1269,6 @@ static int __init i2o_iop_init(void) class_exit: class_destroy(i2o_controller_class); - device_exit: - i2o_device_exit(); - exit: return rc; } @@ -1291,7 +1284,6 @@ static void __exit i2o_iop_exit(void) i2o_exec_exit(); i2o_driver_exit(); class_destroy(i2o_controller_class); - i2o_device_exit(); }; module_init(i2o_iop_init); -- cgit v1.2.3 From 53f4654272df7c51064825024340554b39c9efba Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 27 Oct 2005 22:25:43 -0700 Subject: [PATCH] Driver Core: fix up all callers of class_device_create() The previous patch adding the ability to nest struct class_device changed the paramaters to the call class_device_create(). This patch fixes up all in-kernel users of the function. Signed-off-by: Greg Kroah-Hartman --- drivers/message/i2o/iop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/message/i2o') diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 176fb573ea2..361da8d1d5e 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c @@ -1141,7 +1141,7 @@ int i2o_iop_add(struct i2o_controller *c) goto iop_reset; } - c->classdev = class_device_create(i2o_controller_class, 0, + c->classdev = class_device_create(i2o_controller_class, NULL, MKDEV(0,0), &c->device, "iop%d", c->unit); if (IS_ERR(c->classdev)) { osm_err("%s: could not add controller class\n", c->name); -- cgit v1.2.3 From 3fa63c7d82ab9a12a5d0a299069f8df9f35aa011 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 30 Oct 2005 15:02:23 -0800 Subject: [PATCH] Typo fix: dot after newline in printk strings Typo fix: dots appearing after a newline in printk strings. Signed-off-by: Jean Delvare Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/message/i2o/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/message/i2o') diff --git a/drivers/message/i2o/debug.c b/drivers/message/i2o/debug.c index 018ca887ca8..40d4ea898db 100644 --- a/drivers/message/i2o/debug.c +++ b/drivers/message/i2o/debug.c @@ -90,7 +90,7 @@ static void i2o_report_fail_status(u8 req_status, u32 * msg) }; if (req_status == I2O_FSC_TRANSPORT_UNKNOWN_FAILURE) - printk(KERN_DEBUG "TRANSPORT_UNKNOWN_FAILURE (%0#2x)\n.", + printk(KERN_DEBUG "TRANSPORT_UNKNOWN_FAILURE (%0#2x).\n", req_status); else printk(KERN_DEBUG "TRANSPORT_%s.\n", -- cgit v1.2.3 From 4e57b6817880946a3a78d5d8cad1ace363f7e449 Mon Sep 17 00:00:00 2001 From: Tim Schmielau Date: Sun, 30 Oct 2005 15:03:48 -0800 Subject: [PATCH] fix missing includes I recently picked up my older work to remove unnecessary #includes of sched.h, starting from a patch by Dave Jones to not include sched.h from module.h. This reduces the number of indirect includes of sched.h by ~300. Another ~400 pointless direct includes can be removed after this disentangling (patch to follow later). However, quite a few indirect includes need to be fixed up for this. In order to feed the patches through -mm with as little disturbance as possible, I've split out the fixes I accumulated up to now (complete for i386 and x86_64, more archs to follow later) and post them before the real patch. This way this large part of the patch is kept simple with only adding #includes, and all hunks are independent of each other. So if any hunk rejects or gets in the way of other patches, just drop it. My scripts will pick it up again in the next round. Signed-off-by: Tim Schmielau Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/message/i2o/device.c | 2 ++ drivers/message/i2o/driver.c | 3 +++ drivers/message/i2o/exec-osm.c | 4 ++++ drivers/message/i2o/iop.c | 1 + 4 files changed, 10 insertions(+) (limited to 'drivers/message/i2o') diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index d9879965eb5..8eb50cdb8ae 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include "core.h" /** diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index 0079a4be0af..0fb9c4e2ad4 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c @@ -17,6 +17,9 @@ #include #include #include +#include +#include +#include #include "core.h" #define OSM_NAME "i2o" diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index bda2c62648b..b675b4ebbeb 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c @@ -30,6 +30,10 @@ #include #include #include +#include +#include +#include +#include /* HZ */ #include "core.h" #define OSM_NAME "exec-osm" diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 361da8d1d5e..61b837de4b6 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "core.h" #define OSM_NAME "i2o" -- cgit v1.2.3