* [21/22] USB: gadget: udc: renesas_usb3: no need to check return value of debugfs_create functions
@ 2018-05-29 15:31 Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-05-29 15:31 UTC (permalink / raw
To: linux-usb
Cc: Greg Kroah-Hartman, Felipe Balbi, Yoshihiro Shimoda, Simon Horman,
Geert Uytterhoeven
When calling debugfs functions, there is no need to ever check the
return value. The function can work or not, but the code logic should
never do something different based on this.
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/renesas_usb3.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index 5caf78bbbf7c..977ea1a02cf9 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2391,22 +2391,10 @@ static const struct file_operations renesas_usb3_b_device_fops = {
static void renesas_usb3_debugfs_init(struct renesas_usb3 *usb3,
struct device *dev)
{
- struct dentry *root, *file;
+ usb3->dentry = debugfs_create_dir(dev_name(dev), NULL);
- root = debugfs_create_dir(dev_name(dev), NULL);
- if (IS_ERR_OR_NULL(root)) {
- dev_info(dev, "%s: Can't create the root\n", __func__);
- return;
- }
-
- file = debugfs_create_file("b_device", 0644, root, usb3,
- &renesas_usb3_b_device_fops);
- if (!file) {
- dev_info(dev, "%s: Can't create debugfs mode\n", __func__);
- debugfs_remove_recursive(root);
- } else {
- usb3->dentry = root;
- }
+ debugfs_create_file("b_device", 0644, usb3->dentry, usb3,
+ &renesas_usb3_b_device_fops);
}
/*------- platform_driver ------------------------------------------------*/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [21/22] USB: gadget: udc: renesas_usb3: no need to check return value of debugfs_create functions
@ 2018-05-30 7:38 Yoshihiro Shimoda
0 siblings, 0 replies; 3+ messages in thread
From: Yoshihiro Shimoda @ 2018-05-30 7:38 UTC (permalink / raw
To: Greg Kroah-Hartman, linux-usb@vger.kernel.org
Cc: Felipe Balbi, Simon Horman, Geert Uytterhoeven
> From: Greg Kroah-Hartman, Sent: Wednesday, May 30, 2018 12:31 AM
>
> When calling debugfs functions, there is no need to ever check the
> return value. The function can work or not, but the code logic should
> never do something different based on this.
>
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Cc: Simon Horman <horms+renesas@verge.net.au>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
I tested on r8a7795-salvator-xs. So,
Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Best regards,
Yoshihiro Shimoda
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [21/22] USB: gadget: udc: renesas_usb3: no need to check return value of debugfs_create functions
@ 2018-05-31 10:48 Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-05-31 10:48 UTC (permalink / raw
To: Yoshihiro Shimoda
Cc: linux-usb@vger.kernel.org, Felipe Balbi, Simon Horman,
Geert Uytterhoeven
On Wed, May 30, 2018 at 07:38:24AM +0000, Yoshihiro Shimoda wrote:
> > From: Greg Kroah-Hartman, Sent: Wednesday, May 30, 2018 12:31 AM
> >
> > When calling debugfs functions, there is no need to ever check the
> > return value. The function can work or not, but the code logic should
> > never do something different based on this.
> >
> > Cc: Felipe Balbi <balbi@kernel.org>
> > Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > Cc: Simon Horman <horms+renesas@verge.net.au>
> > Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
>
> I tested on r8a7795-salvator-xs. So,
>
> Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Thanks for testing!
greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-31 10:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-29 15:31 [21/22] USB: gadget: udc: renesas_usb3: no need to check return value of debugfs_create functions Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2018-05-30 7:38 Yoshihiro Shimoda
2018-05-31 10:48 Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.