[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGsJ_4zyfCWhTKsspXC9DV3hR7jYvv1k=MMBSLJsd0aeTs+svQ@mail.gmail.com>
Date: Wed, 19 Feb 2014 08:54:00 +0800
From: Barry Song <21cnbao@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Ohad Ben-Cohen <ohad@...ery.com>,
LKML <linux-kernel@...r.kernel.org>,
DL-SHA-WorkGroupLinux <workgroup.linux@....com>,
Wei Chen <Wei.Chen@....com>, Barry Song <Baohua.Song@....com>
Subject: Re: [PATCH] drivers/rpmsg/virtio_rpmsg_bus.c: fix the return value of rpmsg_init
2014-02-19 6:19 GMT+08:00 Andrew Morton <akpm@...ux-foundation.org>:
> On Mon, 17 Feb 2014 16:13:34 +0800 Barry Song <21cnbao@...il.com> wrote:
>
>> From: Wei Chen <Wei.Chen@....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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists