Message ID | 20190916150921.152977-1-maowenan@huawei.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 3f384d7c490374b2ae8f61a6c67f14deab77bab2 |
Headers | show |
Series | [v3] usbip: vhci_hcd indicate failed message | expand |
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
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; }
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(-)