* [PATCH] usbip: vhci_hcd indicate failed message
@ 2019-09-15 3:43 Mao Wenan
2019-09-15 12:52 ` Greg KH
2019-09-15 13:31 ` walter harms
0 siblings, 2 replies; 7+ messages in thread
From: Mao Wenan @ 2019-09-15 3:43 UTC (permalink / raw)
To: valentina.manea.m, shuah, gregkh
Cc: linux-usb, linux-kernel, kernel-janitors, Mao Wenan
If the return value of vhci_init_attr_group and
sysfs_create_group is non-zero, which mean they failed
to init attr_group and create sysfs group, so it would
better add 'failed' message to indicate that.
Fixes: 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
drivers/usb/usbip/vhci_hcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 000ab7225717..dd54c95d2498 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -1185,12 +1185,12 @@ static int vhci_start(struct usb_hcd *hcd)
if (id == 0 && usb_hcd_is_primary_hcd(hcd)) {
err = vhci_init_attr_group();
if (err) {
- pr_err("init attr group\n");
+ pr_err("init attr group failed\n");
return err;
}
err = sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group);
if (err) {
- pr_err("create sysfs files\n");
+ pr_err("create sysfs failed\n");
vhci_finish_attr_group();
return err;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] usbip: vhci_hcd indicate failed message
2019-09-15 3:43 [PATCH] usbip: vhci_hcd indicate failed message Mao Wenan
@ 2019-09-15 12:52 ` Greg KH
2019-09-15 13:31 ` walter harms
1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2019-09-15 12:52 UTC (permalink / raw)
To: Mao Wenan
Cc: valentina.manea.m, shuah, linux-usb, linux-kernel, kernel-janitors
On Sun, Sep 15, 2019 at 11:43:32AM +0800, Mao Wenan wrote:
> If the return value of vhci_init_attr_group and
> sysfs_create_group is non-zero, which mean they failed
> to init attr_group and create sysfs group, so it would
> better add 'failed' message to indicate that.
>
> Fixes: 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
> drivers/usb/usbip/vhci_hcd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index 000ab7225717..dd54c95d2498 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -1185,12 +1185,12 @@ static int vhci_start(struct usb_hcd *hcd)
> if (id == 0 && usb_hcd_is_primary_hcd(hcd)) {
> err = vhci_init_attr_group();
> if (err) {
> - pr_err("init attr group\n");
> + pr_err("init attr group failed\n");
dev_err() would also be good to use here.
> return err;
> }
> err = sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group);
> if (err) {
> - pr_err("create sysfs files\n");
> + pr_err("create sysfs failed\n");
Same here.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usbip: vhci_hcd indicate failed message
2019-09-15 3:43 [PATCH] usbip: vhci_hcd indicate failed message Mao Wenan
2019-09-15 12:52 ` Greg KH
@ 2019-09-15 13:31 ` walter harms
2019-09-15 14:22 ` [PATCH v2] " Mao Wenan
1 sibling, 1 reply; 7+ messages in thread
From: walter harms @ 2019-09-15 13:31 UTC (permalink / raw)
To: Mao Wenan
Cc: valentina.manea.m, shuah, gregkh, linux-usb, linux-kernel,
kernel-janitors
Am 15.09.2019 05:43, schrieb Mao Wenan:
> If the return value of vhci_init_attr_group and
> sysfs_create_group is non-zero, which mean they failed
> to init attr_group and create sysfs group, so it would
> better add 'failed' message to indicate that.
>
> Fixes: 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
> drivers/usb/usbip/vhci_hcd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index 000ab7225717..dd54c95d2498 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -1185,12 +1185,12 @@ static int vhci_start(struct usb_hcd *hcd)
> if (id == 0 && usb_hcd_is_primary_hcd(hcd)) {
> err = vhci_init_attr_group();
> if (err) {
> - pr_err("init attr group\n");
> + pr_err("init attr group failed\n");
> return err;
> }
> err = sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group);
> if (err) {
> - pr_err("create sysfs files\n");
> + pr_err("create sysfs failed\n");
I guess "sysfs files" is here intended ?
re,
wh
> vhci_finish_attr_group();
> return err;
> }
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] usbip: vhci_hcd indicate failed message
2019-09-15 13:31 ` walter harms
@ 2019-09-15 14:22 ` Mao Wenan
2019-09-16 13:18 ` shuah
0 siblings, 1 reply; 7+ messages in thread
From: Mao Wenan @ 2019-09-15 14:22 UTC (permalink / raw)
To: valentina.manea.m, shuah, gregkh
Cc: linux-usb, linux-kernel, kernel-janitors, Mao Wenan
If the return value of vhci_init_attr_group and
sysfs_create_group is non-zero, which mean they failed
to init attr_group and create sysfs group, so it would
better add 'failed' message to indicate that.
This patch also change pr_err to dev_err to trace which
device is failed.
Fixes: 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
v2: change pr_err to dev_err.
drivers/usb/usbip/vhci_hcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 000ab7225717..bea28ec846ee 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -1185,12 +1185,12 @@ static int vhci_start(struct usb_hcd *hcd)
if (id == 0 && usb_hcd_is_primary_hcd(hcd)) {
err = vhci_init_attr_group();
if (err) {
- pr_err("init attr group\n");
+ dev_err(hcd_dev(hcd), "init attr group failed\n");
return err;
}
err = sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group);
if (err) {
- pr_err("create sysfs files\n");
+ dev_err(hcd_dev(hcd), "create sysfs files failed\n");
vhci_finish_attr_group();
return err;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] usbip: vhci_hcd indicate failed message
2019-09-15 14:22 ` [PATCH v2] " Mao Wenan
@ 2019-09-16 13:18 ` shuah
2019-09-16 15:09 ` [PATCH v3] " Mao Wenan
0 siblings, 1 reply; 7+ messages in thread
From: shuah @ 2019-09-16 13:18 UTC (permalink / raw)
To: Mao Wenan, valentina.manea.m, gregkh
Cc: linux-usb, linux-kernel, kernel-janitors, shuah
On 9/15/19 8:22 AM, Mao Wenan wrote:
> If the return value of vhci_init_attr_group and
> sysfs_create_group is non-zero, which mean they failed
> to init attr_group and create sysfs group, so it would
> better add 'failed' message to indicate that.
> This patch also change pr_err to dev_err to trace which
> device is failed.
>
> Fixes: 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
> v2: change pr_err to dev_err.
> drivers/usb/usbip/vhci_hcd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index 000ab7225717..bea28ec846ee 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -1185,12 +1185,12 @@ static int vhci_start(struct usb_hcd *hcd)
> if (id == 0 && usb_hcd_is_primary_hcd(hcd)) {
> err = vhci_init_attr_group();
> if (err) {
> - pr_err("init attr group\n");
> + dev_err(hcd_dev(hcd), "init attr group failed\n");
Why not include err information in the message. Helps figure out why
it failed.
> return err;
> }
> err = sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group);
> if (err) {
> - pr_err("create sysfs files\n");
> + dev_err(hcd_dev(hcd), "create sysfs files failed\n");
> vhci_finish_attr_group();
> return err;
> }
>
Why not include err information in the message. Helps figure out why
it failed.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3] usbip: vhci_hcd indicate failed message
2019-09-16 13:18 ` shuah
@ 2019-09-16 15:09 ` Mao Wenan
2019-09-16 15:47 ` shuah
0 siblings, 1 reply; 7+ messages in thread
From: Mao Wenan @ 2019-09-16 15:09 UTC (permalink / raw)
To: valentina.manea.m, shuah, gregkh
Cc: linux-usb, linux-kernel, kernel-janitors, Mao Wenan
If the return value of vhci_init_attr_group and
sysfs_create_group is non-zero, which mean they failed
to init attr_group and create sysfs group, so it would
better add 'failed' message to indicate that.
This patch also change pr_err to dev_err to trace which
device is failed.
Fixes: 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
v2: change pr_err to dev_err.
v3: add error code in failed messages.
drivers/usb/usbip/vhci_hcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 000ab7225717..144507751eae 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -1185,12 +1185,12 @@ static int vhci_start(struct usb_hcd *hcd)
if (id == 0 && usb_hcd_is_primary_hcd(hcd)) {
err = vhci_init_attr_group();
if (err) {
- pr_err("init attr group\n");
+ dev_err(hcd_dev(hcd), "init attr group failed, err = %d\n", err);
return err;
}
err = sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group);
if (err) {
- pr_err("create sysfs files\n");
+ dev_err(hcd_dev(hcd), "create sysfs files failed, err = %d\n", err);
vhci_finish_attr_group();
return err;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3] usbip: vhci_hcd indicate failed message
2019-09-16 15:09 ` [PATCH v3] " Mao Wenan
@ 2019-09-16 15:47 ` shuah
0 siblings, 0 replies; 7+ messages in thread
From: shuah @ 2019-09-16 15:47 UTC (permalink / raw)
To: Mao Wenan, valentina.manea.m, gregkh
Cc: linux-usb, linux-kernel, kernel-janitors, shuah
On 9/16/19 9:09 AM, Mao Wenan wrote:
> If the return value of vhci_init_attr_group and
> sysfs_create_group is non-zero, which mean they failed
> to init attr_group and create sysfs group, so it would
> better add 'failed' message to indicate that.
> This patch also change pr_err to dev_err to trace which
> device is failed.
>
> Fixes: 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
> v2: change pr_err to dev_err.
> v3: add error code in failed messages.
> drivers/usb/usbip/vhci_hcd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index 000ab7225717..144507751eae 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -1185,12 +1185,12 @@ static int vhci_start(struct usb_hcd *hcd)
> if (id == 0 && usb_hcd_is_primary_hcd(hcd)) {
> err = vhci_init_attr_group();
> if (err) {
> - pr_err("init attr group\n");
> + dev_err(hcd_dev(hcd), "init attr group failed, err = %d\n", err);
> return err;
> }
> err = sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group);
> if (err) {
> - pr_err("create sysfs files\n");
> + dev_err(hcd_dev(hcd), "create sysfs files failed, err = %d\n", err);
> vhci_finish_attr_group();
> return err;
> }
>
Looks good to me.
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-09-16 15:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-15 3:43 [PATCH] usbip: vhci_hcd indicate failed message Mao Wenan
2019-09-15 12:52 ` Greg KH
2019-09-15 13:31 ` walter harms
2019-09-15 14:22 ` [PATCH v2] " Mao Wenan
2019-09-16 13:18 ` shuah
2019-09-16 15:09 ` [PATCH v3] " Mao Wenan
2019-09-16 15:47 ` shuah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).