Re: [PATCH] tc: account for device_register() failure

2014-04-01 Thread Levente Kurusa
Hi,

2014-04-01 2:30 GMT+02:00 Maciej W. Rozycki :
> 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 
>
> Acked-by: Maciej W. Rozycki 
>
> 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  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.

Sure, I will repost in a few hours, I just need to get home.
Thanks for the Ack!

> [...]

--
Regards,
Levente Kurusa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] tc: account for device_register() failure

2014-03-31 Thread Maciej W. Rozycki
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 

Acked-by: Maciej W. Rozycki 

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  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) / 10;
> 

  Maciej
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] tc: account for device_register() failure

2013-11-15 Thread Levente Kurusa
This patch makes the TURBOchannel driver bail out if the call
to device_register() failed.

Signed-off-by: Levente Kurusa 
---
 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) / 10;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/