public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Levente Kurusa <levex@linux.com>, Ralf Baechle <ralf@linux-mips.org>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-mips@linux-mips.org
Subject: Re: [PATCH] tc: account for device_register() failure
Date: Tue, 1 Apr 2014 01:30:56 +0100 (BST)	[thread overview]
Message-ID: <alpine.LFD.2.11.1404010108270.27402@eddie.linux-mips.org> (raw)
In-Reply-To: <52863D5E.7080606@linux.com>

On Fri, 15 Nov 2013, Levente Kurusa wrote:

> This patch makes the TURBOchannel driver bail out if the call
> to device_register() failed.
> 
> Signed-off-by: Levente Kurusa <levex@linux.com>

Acked-by: Maciej W. Rozycki <macro@linux-mips.org>

This fixes some build warnings:

drivers/tc/tc.c: In function 'tc_bus_add_devices':
drivers/tc/tc.c:132: warning: ignoring return value of 'device_register', 
declared with attribute warn_unused_result
drivers/tc/tc.c: In function 'tc_init':
drivers/tc/tc.c:151: warning: ignoring return value of 'device_register', 
declared with attribute warn_unused_result

Levente, thanks for your fix and apologies for the long RTT -- can you 
please resend your patch to <linux-mips@linux-mips.org> and Ralf so that 
it'll be pulled via the MIPS tree?  I'll post a follow-up update to fix 
some issues with `tc_init' that I noticed thanks to your change.

> ---
>  tc.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tc/tc.c b/drivers/tc/tc.c
> index a8aaf6a..6b3a038 100644
> --- a/drivers/tc/tc.c
> +++ b/drivers/tc/tc.c
> @@ -129,7 +129,10 @@ static void __init tc_bus_add_devices(struct tc_bus *tbus)
> 
>  		tc_device_get_irq(tdev);
> 
> -		device_register(&tdev->dev);
> +		if (device_register(&tdev->dev)) {
> +			put_device(&tdev->dev);
> +			goto out_err;
> +		}
>  		list_add_tail(&tdev->node, &tbus->devices);
> 
>  out_err:
> @@ -148,7 +151,10 @@ static int __init tc_init(void)
> 
>  	INIT_LIST_HEAD(&tc_bus.devices);
>  	dev_set_name(&tc_bus.dev, "tc");
> -	device_register(&tc_bus.dev);
> +	if (device_register(&tc_bus.dev)) {
> +		put_device(&tc_bus.dev);
> +		return 0;	
> +	}
> 
>  	if (tc_bus.info.slot_size) {
>  		unsigned int tc_clock = tc_get_speed(&tc_bus) / 100000;
> 

  Maciej

  reply	other threads:[~2014-04-01  0:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 15:27 [PATCH] tc: account for device_register() failure Levente Kurusa
2014-04-01  0:30 ` Maciej W. Rozycki [this message]
2014-04-01 13:03   ` Levente Kurusa

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=alpine.LFD.2.11.1404010108270.27402@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=levex@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox