From: Mark Gross <mgross@linux.intel.com>
To: Akinobu Mita <akinobu.mita@gmail.com>,
linux-kernel@vger.kernel.org,
Sebastien Bouchard <sebastien.bouchard@ca.kontron.com>,
akpm@osdl.org
Subject: Re: [PATCH] tlclk: fix platform_device_register_simple() error check
Date: Mon, 27 Nov 2006 12:34:52 -0800 [thread overview]
Message-ID: <20061127203452.GA12279@linux.intel.com> (raw)
In-Reply-To: <20061122184111.GC2985@APFDCB5C>
On Thu, Nov 23, 2006 at 03:41:11AM +0900, Akinobu Mita wrote:
> The return value of platform_device_register_simple() should be
> checked by IS_ERR().
>
> This patch also fix misc_register() error case. Because misc_register()
> returns error code.
>
> Cc: Sebastien Bouchard <sebastien.bouchard@ca.kontron.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>
> ---
> drivers/char/tlclk.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> Index: work-fault-inject/drivers/char/tlclk.c
> ===================================================================
> --- work-fault-inject.orig/drivers/char/tlclk.c
> +++ work-fault-inject/drivers/char/tlclk.c
> @@ -792,15 +792,14 @@ static int __init tlclk_init(void)
> ret = misc_register(&tlclk_miscdev);
> if (ret < 0) {
> printk(KERN_ERR "tlclk: misc_register returns %d.\n", ret);
> - ret = -EBUSY;
results in an non-error return when there this device isn't on the
system.
* NAK *
> goto out3;
> }
>
> tlclk_device = platform_device_register_simple("telco_clock",
> -1, NULL, 0);
> - if (!tlclk_device) {
> + if (IS_ERR(tlclk_device)) {
ok
> printk(KERN_ERR "tlclk: platform_device_register failed.\n");
> - ret = -EBUSY;
> + ret = PTR_ERR(tlclk_device);
I don't know about this but I could be wrong. Please convince me.
> goto out4;
> }
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2006-11-27 20:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-22 18:41 [PATCH] tlclk: fix platform_device_register_simple() error check Akinobu Mita
2006-11-27 20:34 ` Mark Gross [this message]
2006-11-27 20:46 ` Mark Gross
2006-11-28 6:08 ` Akinobu Mita
2006-11-29 21:17 ` Mark Gross
2006-12-02 4:03 ` Akinobu Mita
2006-12-05 18:25 ` Mark Gross
2007-01-03 16:56 ` Mark Gross
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=20061127203452.GA12279@linux.intel.com \
--to=mgross@linux.intel.com \
--cc=akinobu.mita@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastien.bouchard@ca.kontron.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox