LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] raw: return negative from raw_init()
@ 2006-09-12  1:19 Alexey Dobriyan
  2006-09-12  3:34 ` Dmitry Torokhov
  2006-09-14 21:31 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Dobriyan @ 2006-09-12  1:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 drivers/char/raw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -312,7 +312,7 @@ static int __init raw_init(void)
 
 error:
 	printk(KERN_ERR "error register raw device\n");
-	return 1;
+	return -1;
 }
 
 static void __exit raw_exit(void)


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

* Re: [PATCH] raw: return negative from raw_init()
  2006-09-12  1:19 [PATCH] raw: return negative from raw_init() Alexey Dobriyan
@ 2006-09-12  3:34 ` Dmitry Torokhov
  2006-09-14 21:31 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2006-09-12  3:34 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Andrew Morton, linux-kernel

On Monday 11 September 2006 21:19, Alexey Dobriyan wrote:
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  drivers/char/raw.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/char/raw.c
> +++ b/drivers/char/raw.c
> @@ -312,7 +312,7 @@ static int __init raw_init(void)
>  
>  error:
>  	printk(KERN_ERR "error register raw device\n");
> -	return 1;
> +	return -1;
>  }
>  

How about reworking it a bit to pass true error code from the failed
call? Additionally class_device_create call is not checked for errors
there.  

-- 
Dmitry

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

* Re: [PATCH] raw: return negative from raw_init()
  2006-09-12  1:19 [PATCH] raw: return negative from raw_init() Alexey Dobriyan
  2006-09-12  3:34 ` Dmitry Torokhov
@ 2006-09-14 21:31 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2006-09-14 21:31 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: linux-kernel

On Tue, 12 Sep 2006 05:19:18 +0400
Alexey Dobriyan <adobriyan@gmail.com> wrote:

> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  drivers/char/raw.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/char/raw.c
> +++ b/drivers/char/raw.c
> @@ -312,7 +312,7 @@ static int __init raw_init(void)
>  
>  error:
>  	printk(KERN_ERR "error register raw device\n");
> -	return 1;
> +	return -1;
>  }
>  
>  static void __exit raw_exit(void)

Rolf got there first.  Please review
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc6/2.6.18-rc6-mm2/broken-out/return-better-error-codes-if-drivers-char-rawc-module-init-fails.patch

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

end of thread, other threads:[~2006-09-14 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-12  1:19 [PATCH] raw: return negative from raw_init() Alexey Dobriyan
2006-09-12  3:34 ` Dmitry Torokhov
2006-09-14 21:31 ` Andrew Morton

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).