All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: linux-acpi@vger.kernel.org,
	Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Subject: Re: [PATCH] ACPI: bay: use IS_ERR for return of register_platform_device_simple
Date: Wed, 14 Feb 2007 16:14:31 -0500	[thread overview]
Message-ID: <200702141614.32024.lenb@kernel.org> (raw)
In-Reply-To: <20070214125459.GB4447@khazad-dum.debian.net>

Applied,

thanks,
-Len

On Wednesday 14 February 2007 07:55, Henrique de Moraes Holschuh wrote:
> register_platform_device_simple returns ERR_PTR(foo), so test it with
> IS_ERR(foo).
> 
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> 
> ---
> 
> I wonder how many of these are in the kernel?  An annotation for this would be
> a good idea.  It doesn't help that people, as usual, do not see fit to document
> how the heck they return errors, so you have to track down the source of every
> function you are not intimately familiar with before using it.
> ---
>  drivers/acpi/bay.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c
> index dcf5f42..fb3f31b 100644
> --- a/drivers/acpi/bay.c
> +++ b/drivers/acpi/bay.c
> @@ -281,7 +281,7 @@ static int bay_add(acpi_handle handle, int id)
>  
>  	/* initialize platform device stuff */
>  	pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0);
> -	if (pdev == NULL) {
> +	if (IS_ERR(pdev)) {
>  		printk(KERN_ERR PREFIX "Error registering bay device\n");
>  		goto bay_add_err;
>  	}
> -- 
> 1.4.4.4
> 

      reply	other threads:[~2007-02-14 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14 12:55 [PATCH] ACPI: bay: use IS_ERR for return of register_platform_device_simple Henrique de Moraes Holschuh
2007-02-14 21:14 ` Len Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200702141614.32024.lenb@kernel.org \
    --to=lenb@kernel.org \
    --cc=hmh@hmh.eng.br \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.