linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 06/14] acpi/scan: handle kset/kobject errors
@ 2006-08-15  5:37 akpm
  2006-08-16  3:32 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2006-08-15  5:37 UTC (permalink / raw)
  To: len.brown; +Cc: linux-acpi, akpm, rdunlap

From: Randy Dunlap <rdunlap@xenotime.net>

Check and handle kset_register() and kobject_register() init errors.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/acpi/scan.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN drivers/acpi/scan.c~acpi-scan-handle-kset-kobject-errors drivers/acpi/scan.c
--- a/drivers/acpi/scan.c~acpi-scan-handle-kset-kobject-errors
+++ a/drivers/acpi/scan.c
@@ -4,6 +4,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/kernel.h>
 #include <linux/acpi.h>
 
 #include <acpi/acpi_drivers.h>
@@ -113,6 +114,8 @@ static struct kset acpi_namespace_kset =
 static void acpi_device_register(struct acpi_device *device,
 				 struct acpi_device *parent)
 {
+	int err;
+
 	/*
 	 * Linkage
 	 * -------
@@ -138,7 +141,10 @@ static void acpi_device_register(struct 
 		device->kobj.parent = &parent->kobj;
 	device->kobj.ktype = &ktype_acpi_ns;
 	device->kobj.kset = &acpi_namespace_kset;
-	kobject_register(&device->kobj);
+	err = kobject_register(&device->kobj);
+	if (err < 0)
+		printk(KERN_WARNING "%s: kobject_register error: %d\n",
+			__FUNCTION__, err);
 	create_sysfs_device_files(device);
 }
 
@@ -1450,7 +1456,9 @@ static int __init acpi_scan_init(void)
 	if (acpi_disabled)
 		return 0;
 
-	kset_register(&acpi_namespace_kset);
+	result = kset_register(&acpi_namespace_kset);
+	if (result < 0)
+		printk(KERN_ERR PREFIX "kset_register error: %d\n", result);
 
 	result = bus_register(&acpi_bus_type);
 	if (result) {
_

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

* Re: [patch 06/14] acpi/scan: handle kset/kobject errors
  2006-08-15  5:37 [patch 06/14] acpi/scan: handle kset/kobject errors akpm
@ 2006-08-16  3:32 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2006-08-16  3:32 UTC (permalink / raw)
  To: akpm; +Cc: linux-acpi, rdunlap

applied.

thanks,
-len

On Tuesday 15 August 2006 01:37, akpm@osdl.org wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
> 
> Check and handle kset_register() and kobject_register() init errors.
> 
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
> 
>  drivers/acpi/scan.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff -puN drivers/acpi/scan.c~acpi-scan-handle-kset-kobject-errors drivers/acpi/scan.c
> --- a/drivers/acpi/scan.c~acpi-scan-handle-kset-kobject-errors
> +++ a/drivers/acpi/scan.c
> @@ -4,6 +4,7 @@
>  
>  #include <linux/module.h>
>  #include <linux/init.h>
> +#include <linux/kernel.h>
>  #include <linux/acpi.h>
>  
>  #include <acpi/acpi_drivers.h>
> @@ -113,6 +114,8 @@ static struct kset acpi_namespace_kset =
>  static void acpi_device_register(struct acpi_device *device,
>  				 struct acpi_device *parent)
>  {
> +	int err;
> +
>  	/*
>  	 * Linkage
>  	 * -------
> @@ -138,7 +141,10 @@ static void acpi_device_register(struct 
>  		device->kobj.parent = &parent->kobj;
>  	device->kobj.ktype = &ktype_acpi_ns;
>  	device->kobj.kset = &acpi_namespace_kset;
> -	kobject_register(&device->kobj);
> +	err = kobject_register(&device->kobj);
> +	if (err < 0)
> +		printk(KERN_WARNING "%s: kobject_register error: %d\n",
> +			__FUNCTION__, err);
>  	create_sysfs_device_files(device);
>  }
>  
> @@ -1450,7 +1456,9 @@ static int __init acpi_scan_init(void)
>  	if (acpi_disabled)
>  		return 0;
>  
> -	kset_register(&acpi_namespace_kset);
> +	result = kset_register(&acpi_namespace_kset);
> +	if (result < 0)
> +		printk(KERN_ERR PREFIX "kset_register error: %d\n", result);
>  
>  	result = bus_register(&acpi_bus_type);
>  	if (result) {
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2006-08-16  3:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-15  5:37 [patch 06/14] acpi/scan: handle kset/kobject errors akpm
2006-08-16  3:32 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).