diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-01-17 16:34:11 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-02-20 09:16:17 -0600 |
commit | 798a2468e026ab6a922f2c6c70ca4406b8e8dbc1 (patch) | |
tree | 77849cb88826a1dfe8fd7539e7770db47e81f460 /drivers/usb | |
parent | 3fcba0d87bfb5f880d34868090e05571dca80f78 (diff) | |
download | linux-798a2468e026ab6a922f2c6c70ca4406b8e8dbc1.tar.bz2 |
usb: gadget: gr_udc: remove some unneeded error handling
Debugfs function return an ERR_PTR if they compiled out. We don't need
to test for that here because if the debugfs file are compiled out then
it is ok to pass an ERR_PTR to debugfs_create_file() since it will just
be a no-op stub.
Debugfs return NULLs on error, but we don't need to test for that either
because debugfs_create_file() will accept NULL pointers.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/gr_udc.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/usb/gadget/gr_udc.c b/drivers/usb/gadget/gr_udc.c index 914cbd84ee40..f984ee75324d 100644 --- a/drivers/usb/gadget/gr_udc.c +++ b/drivers/usb/gadget/gr_udc.c @@ -225,14 +225,8 @@ static void gr_dfs_create(struct gr_udc *dev) const char *name = "gr_udc_state"; dev->dfs_root = debugfs_create_dir(dev_name(dev->dev), NULL); - if (IS_ERR(dev->dfs_root)) { - dev_err(dev->dev, "Failed to create debugfs directory\n"); - return; - } - dev->dfs_state = debugfs_create_file(name, 0444, dev->dfs_root, - dev, &gr_dfs_fops); - if (IS_ERR(dev->dfs_state)) - dev_err(dev->dev, "Failed to create debugfs file %s\n", name); + dev->dfs_state = debugfs_create_file(name, 0444, dev->dfs_root, dev, + &gr_dfs_fops); } static void gr_dfs_delete(struct gr_udc *dev) |