ieee1394: Consolidate driver registering
This patch consolidates some bookkeeping for driver registering. It closely models what pci_register_driver() does. The main addition is that the owner of the driver is set, so we get a proper symlink for /sys/bus/ieee1394/driver/*/module. Also moves setting of name and bus type into nodemgr. Because of this, we can remove the EXPORT_SYMBOL for ieee1394_bus_type, since it's now only used in ieee1394.ko. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:

committed by
Stefan Richter

parent
9b7d9c096d
commit
ed30c26ee8
@@ -1282,12 +1282,19 @@ static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp,
|
||||
#endif /* CONFIG_HOTPLUG */
|
||||
|
||||
|
||||
int hpsb_register_protocol(struct hpsb_protocol_driver *driver)
|
||||
int __hpsb_register_protocol(struct hpsb_protocol_driver *drv,
|
||||
struct module *owner)
|
||||
{
|
||||
int error;
|
||||
|
||||
drv->driver.bus = &ieee1394_bus_type;
|
||||
drv->driver.owner = owner;
|
||||
drv->driver.name = drv->name;
|
||||
|
||||
/* This will cause a probe for devices */
|
||||
int error = driver_register(&driver->driver);
|
||||
error = driver_register(&drv->driver);
|
||||
if (!error)
|
||||
nodemgr_create_drv_files(driver);
|
||||
nodemgr_create_drv_files(drv);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user