slimbus: Add slimbus device driver unregistration function

slim_driver_unregister is added to reverse effects of
slim_driver_register. That way a slimbus device driver can be
registered when driver module is loaded, and unregistered when
the driver module is unloaded.

CRs-Fixed: 441540
Change-Id: Iae64f84c99d5027c9b55c3fde5fe71c6a550354e
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
This commit is contained in:
Sagar Dharia
2013-02-14 10:48:26 -08:00
committed by Jay Chokshi
parent 8dc6e18336
commit 371bfa266f
2 changed files with 18 additions and 1 deletions
+11
View File
@@ -233,6 +233,17 @@ int slim_driver_register(struct slim_driver *drv)
}
EXPORT_SYMBOL_GPL(slim_driver_register);
/*
* slim_driver_unregister: Undo effects of slim_driver_register
* @drv: Client driver to be unregistered
*/
void slim_driver_unregister(struct slim_driver *drv)
{
if (drv)
driver_unregister(&drv->driver);
}
EXPORT_SYMBOL_GPL(slim_driver_unregister);
#define slim_ctrl_attr_gr NULL
static void slim_ctrl_release(struct device *dev)
+7 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -961,6 +961,12 @@ extern int slim_ctrl_clk_pause(struct slim_controller *ctrl, bool wakeup,
*/
extern int slim_driver_register(struct slim_driver *drv);
/*
* slim_driver_unregister: Undo effects of slim_driver_register
* @drv: Client driver to be unregistered
*/
extern void slim_driver_unregister(struct slim_driver *drv);
/*
* slim_add_numbered_controller: Controller bring-up.
* @ctrl: Controller to be registered.