mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/rpmsg/virtio_rpmsg_bus.c: fix the return value of rpmsg_init
@ 2014-02-17  8:13 Barry Song
  2014-02-18 22:19 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Song @ 2014-02-17  8:13 UTC (permalink / raw)
  To: akpm, ohad; +Cc: linux-kernel, workgroup.linux, Wei Chen, Barry Song

From: Wei Chen <Wei.Chen@csr.com>

rpmsg_init() always return ERROR code or random integer now, this patch fixes
it.

Signed-off-by: Wei Chen <Wei.Chen@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/rpmsg/virtio_rpmsg_bus.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index b6135d4..7812585 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -1096,9 +1096,10 @@ static int __init rpmsg_init(void)
 	if (ret) {
 		pr_err("failed to register virtio driver: %d\n", ret);
 		bus_unregister(&rpmsg_bus);
+		return ret;
 	}
 
-	return ret;
+	return 0;
 }
 subsys_initcall(rpmsg_init);
 
-- 
1.7.5.4


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

* Re: [PATCH] drivers/rpmsg/virtio_rpmsg_bus.c: fix the return value of rpmsg_init
  2014-02-17  8:13 [PATCH] drivers/rpmsg/virtio_rpmsg_bus.c: fix the return value of rpmsg_init Barry Song
@ 2014-02-18 22:19 ` Andrew Morton
  2014-02-19  0:54   ` Barry Song
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2014-02-18 22:19 UTC (permalink / raw)
  To: Barry Song; +Cc: ohad, linux-kernel, workgroup.linux, Wei Chen, Barry Song

On Mon, 17 Feb 2014 16:13:34 +0800 Barry Song <21cnbao@gmail.com> wrote:

> From: Wei Chen <Wei.Chen@csr.com>
> 
> rpmsg_init() always return ERROR code or random integer now, this patch fixes
> it.
> 
> ...
>
> --- a/drivers/rpmsg/virtio_rpmsg_bus.c
> +++ b/drivers/rpmsg/virtio_rpmsg_bus.c
> @@ -1096,9 +1096,10 @@ static int __init rpmsg_init(void)
>  	if (ret) {
>  		pr_err("failed to register virtio driver: %d\n", ret);
>  		bus_unregister(&rpmsg_bus);
> +		return ret;
>  	}
>  
> -	return ret;
> +	return 0;
>  }

Look more closely.  This patch has no effect...

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

* Re: [PATCH] drivers/rpmsg/virtio_rpmsg_bus.c: fix the return value of rpmsg_init
  2014-02-18 22:19 ` Andrew Morton
@ 2014-02-19  0:54   ` Barry Song
  0 siblings, 0 replies; 3+ messages in thread
From: Barry Song @ 2014-02-19  0:54 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ohad Ben-Cohen, LKML, DL-SHA-WorkGroupLinux, Wei Chen, Barry Song

2014-02-19 6:19 GMT+08:00 Andrew Morton <akpm@linux-foundation.org>:
> On Mon, 17 Feb 2014 16:13:34 +0800 Barry Song <21cnbao@gmail.com> wrote:
>
>> From: Wei Chen <Wei.Chen@csr.com>
>>
>> rpmsg_init() always return ERROR code or random integer now, this patch fixes
>> it.
>>
>> ...
>>
>> --- a/drivers/rpmsg/virtio_rpmsg_bus.c
>> +++ b/drivers/rpmsg/virtio_rpmsg_bus.c
>> @@ -1096,9 +1096,10 @@ static int __init rpmsg_init(void)
>>       if (ret) {
>>               pr_err("failed to register virtio driver: %d\n", ret);
>>               bus_unregister(&rpmsg_bus);
>> +             return ret;
>>       }
>>
>> -     return ret;
>> +     return 0;
>>  }
>
> Look more closely.  This patch has no effect...

yes, when i look again i find it does have no effect as successful
bus_register() has made ret 0. but the codes are much unreadable
then....

static int __init rpmsg_init(void)
{
        int ret;

        ret = bus_register(&rpmsg_bus);
        if (ret) {
                pr_err("failed to register rpmsg bus: %d\n", ret);
                return ret;
        }

        ret = register_virtio_driver(&virtio_ipc_driver);
        if (ret) {
                pr_err("failed to register virtio driver: %d\n", ret);
                bus_unregister(&rpmsg_bus);
        }

        return ret;
}
subsys_initcall(rpmsg_init);

-barry

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

end of thread, other threads:[~2014-02-19  0:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-17  8:13 [PATCH] drivers/rpmsg/virtio_rpmsg_bus.c: fix the return value of rpmsg_init Barry Song
2014-02-18 22:19 ` Andrew Morton
2014-02-19  0:54   ` Barry Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®