diff options
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 4b49641effa1..c0d0a5490ac6 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -682,7 +682,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister); struct platform_device *platform_device_register_full( const struct platform_device_info *pdevinfo) { - int ret = -ENOMEM; + int ret; struct platform_device *pdev; pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id); @@ -863,6 +863,8 @@ int __init_or_module __platform_driver_probe(struct platform_driver *drv, /* temporary section violation during probe() */ drv->probe = probe; retval = code = __platform_driver_register(drv, module); + if (retval) + return retval; /* * Fixup that section violation, being paranoid about code scanning @@ -987,7 +989,7 @@ EXPORT_SYMBOL_GPL(__platform_register_drivers); * @drivers: an array of drivers to unregister * @count: the number of drivers to unregister * - * Unegisters platform drivers specified by an array. This is typically used + * Unregisters platform drivers specified by an array. This is typically used * to complement an earlier call to platform_register_drivers(). Drivers are * unregistered in the reverse order in which they were registered. */ |