diff options
author | David Kershner <david.kershner@unisys.com> | 2017-03-28 09:34:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-29 09:17:03 +0200 |
commit | 5b6f9b95f7aeddf8a77a991bf1657a84ca281ab0 (patch) | |
tree | ef0548bfcfd4bc9b87f96a23c5e3ed1556798852 /drivers/staging/unisys | |
parent | 362f87f3122d1f744bb09caa40e86fae5d9f4c60 (diff) |
staging: unisys: visorbus: get rid of create_bus_type.
Create bus_type was just calling register_bustype. Since we control how
many times we call create_bus_type it was extraneous keeping a counter if
the bus was already registered, so the functions were no longer needed.
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r-- | drivers/staging/unisys/visorbus/visorbus_main.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 3e756ca1e449..dedcee485b61 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -33,7 +33,6 @@ static int visorbus_forcenomatch; #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c #define POLLJIFFIES_NORMALCHANNEL 10 -static int busreg_rc = -ENODEV; /* stores the result from bus registration */ static struct dentry *visorbus_debugfs_dir; /* @@ -967,9 +966,6 @@ int visorbus_register_visor_driver(struct visor_driver *drv) { int rc = 0; - if (busreg_rc < 0) - return -ENODEV; /*can't register on a nonexistent bus*/ - drv->driver.name = drv->name; drv->driver.bus = &visorbus_type; drv->driver.probe = visordriver_probe_device; @@ -1081,29 +1077,6 @@ remove_bus_instance(struct visor_device *dev) } /* - * create_bus_type() - create and register the one-and-only one instance of - * the visor bus type (visorbus_type) - * Return: 0 for success, otherwise negative errno value returned by - * bus_register() indicating the reason for failure - */ -static int -create_bus_type(void) -{ - busreg_rc = bus_register(&visorbus_type); - return busreg_rc; -} - -/* - * remove_bus_type() - remove the one-and-only one instance of the visor bus - * type (visorbus_type) - */ -static void -remove_bus_type(void) -{ - bus_unregister(&visorbus_type); -} - -/* * remove_all_visor_devices() - remove all child visor bus device instances */ static void @@ -1335,7 +1308,7 @@ visorbus_init(void) bus_device_info_init(&clientbus_driverinfo, "clientbus", "visorbus"); - err = create_bus_type(); + err = bus_register(&visorbus_type); if (err < 0) { POSTCODE_LINUX(BUS_CREATE_ENTRY_PC, 0, 0, DIAG_SEVERITY_ERR); goto error; @@ -1363,7 +1336,8 @@ visorbus_exit(void) list_all); remove_bus_instance(dev); } - remove_bus_type(); + + bus_unregister(&visorbus_type); debugfs_remove_recursive(visorbus_debugfs_dir); } |