public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 10/24] drivers/base: return actual error on sysfs init
@ 2014-06-17 14:36 Jeff Liu
  2014-06-17 19:22 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Liu @ 2014-06-17 14:36 UTC (permalink / raw)
  To: gregkh; +Cc: LKML

From: Jie Liu <jeff.liu@oracle.com>

This patch fix all sysfs init functions under drivers core to
return the actual error code than the hardcoded ENOMEM.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 drivers/base/bus.c   | 16 ++++++++--------
 drivers/base/class.c |  4 ++--
 drivers/base/core.c  |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 83e910a..b0590a7 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -901,15 +901,15 @@ int bus_register(struct bus_type *bus)
 
 	priv->devices_kset = kset_create_and_add("devices", NULL,
 						 &priv->subsys.kobj);
-	if (!priv->devices_kset) {
-		retval = -ENOMEM;
+	if (IS_ERR(priv->devices_kset)) {
+		retval = PTR_ERR(priv->devices_kset);
 		goto bus_devices_fail;
 	}
 
 	priv->drivers_kset = kset_create_and_add("drivers", NULL,
 						 &priv->subsys.kobj);
-	if (!priv->drivers_kset) {
-		retval = -ENOMEM;
+	if (IS_ERR(priv->drivers_kset)) {
+		retval = PTR_ERR(priv->drivers_kset);
 		goto bus_drivers_fail;
 	}
 
@@ -1261,12 +1261,12 @@ EXPORT_SYMBOL_GPL(subsys_virtual_register);
 int __init buses_init(void)
 {
 	bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL);
-	if (!bus_kset)
-		return -ENOMEM;
+	if (IS_ERR(bus_kset))
+		return PTR_ERR(bus_kset);
 
 	system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj);
-	if (!system_kset)
-		return -ENOMEM;
+	if (IS_ERR(system_kset))
+		return PTR_ERR(system_kset);
 
 	return 0;
 }
diff --git a/drivers/base/class.c b/drivers/base/class.c
index f96f704..56e16fa 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -584,8 +584,8 @@ EXPORT_SYMBOL_GPL(class_compat_remove_link);
 int __init classes_init(void)
 {
 	class_kset = kset_create_and_add("class", NULL, NULL);
-	if (!class_kset)
-		return -ENOMEM;
+	if (IS_ERR(class_kset))
+		return PTR_ERR(class_kset);
 	return 0;
 }
 
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 20da3ad..0f729f9 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1364,8 +1364,8 @@ EXPORT_SYMBOL_GPL(device_find_child);
 int __init devices_init(void)
 {
 	devices_kset = kset_create_and_add("devices", &device_uevent_ops, NULL);
-	if (!devices_kset)
-		return -ENOMEM;
+	if (IS_ERR(devices_kset))
+		return PTR_ERR(devices_kset);
 	dev_kobj = kobject_create_and_add("dev", NULL);
 	if (!dev_kobj)
 		goto dev_kobj_err;
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 10/24] drivers/base: return actual error on sysfs init
  2014-06-17 14:36 [PATCH 10/24] drivers/base: return actual error on sysfs init Jeff Liu
@ 2014-06-17 19:22 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2014-06-17 19:22 UTC (permalink / raw)
  To: Jeff Liu; +Cc: LKML

On Tue, Jun 17, 2014 at 10:36:39PM +0800, Jeff Liu wrote:
> From: Jie Liu <jeff.liu@oracle.com>
> 
> This patch fix all sysfs init functions under drivers core to
> return the actual error code than the hardcoded ENOMEM.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
> ---
>  drivers/base/bus.c   | 16 ++++++++--------
>  drivers/base/class.c |  4 ++--
>  drivers/base/core.c  |  4 ++--
>  3 files changed, 12 insertions(+), 12 deletions(-)

Nope, not taking this.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-17 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-17 14:36 [PATCH 10/24] drivers/base: return actual error on sysfs init Jeff Liu
2014-06-17 19:22 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox