summaryrefslogtreecommitdiff
path: root/drivers/mcb/mcb-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mcb/mcb-core.c')
-rw-r--r--drivers/mcb/mcb-core.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
index c1367223e71a..e6e7c11bac6c 100644
--- a/drivers/mcb/mcb-core.c
+++ b/drivers/mcb/mcb-core.c
@@ -85,7 +85,8 @@ static void mcb_remove(struct device *dev)
struct mcb_device *mdev = to_mcb_device(dev);
struct module *carrier_mod;
- mdrv->remove(mdev);
+ if (mdrv->remove)
+ mdrv->remove(mdev);
carrier_mod = mdev->dev.parent->driver->owner;
module_put(carrier_mod);
@@ -176,13 +177,13 @@ static const struct device_type mcb_carrier_device_type = {
* @owner: The @mcb_driver's module
* @mod_name: The name of the @mcb_driver's module
*
- * Register a @mcb_driver at the system. Perform some sanity checks, if
- * the .probe and .remove methods are provided by the driver.
+ * Register a @mcb_driver at the system. Perform a sanity check, if
+ * .probe method is provided by the driver.
*/
int __mcb_register_driver(struct mcb_driver *drv, struct module *owner,
const char *mod_name)
{
- if (!drv->probe || !drv->remove)
+ if (!drv->probe)
return -EINVAL;
drv->driver.owner = owner;
@@ -273,7 +274,7 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
int bus_nr;
int rc;
- bus = kzalloc(sizeof(struct mcb_bus), GFP_KERNEL);
+ bus = kzalloc_obj(struct mcb_bus);
if (!bus)
return ERR_PTR(-ENOMEM);
@@ -365,7 +366,7 @@ struct mcb_device *mcb_alloc_dev(struct mcb_bus *bus)
{
struct mcb_device *dev;
- dev = kzalloc(sizeof(struct mcb_device), GFP_KERNEL);
+ dev = kzalloc_obj(struct mcb_device);
if (!dev)
return NULL;