summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-01-31 13:33:32 +0200
committerFelipe Balbi <balbi@ti.com>2012-02-06 11:48:41 +0200
commit3d4c0d4ffb418800b2d1af111f9e1d5b204ee55c (patch)
treec4249599f33d1c402c0689272e9074a884846c6d /drivers/usb/dwc3
parent45b3cd4ad79b31289aa7da7a6448ec5afb7780a4 (diff)
downloadop-kernel-dev-3d4c0d4ffb418800b2d1af111f9e1d5b204ee55c.zip
op-kernel-dev-3d4c0d4ffb418800b2d1af111f9e1d5b204ee55c.tar.gz
usb: dwc3: debugfs: fix error check
debugfs APIs will return NULL if it fails to create the file/directory we ask it to create. Instead of checking for IS_ERR(ptr) we must check for !ptr. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/debugfs.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index a2c1cc6..78ec092 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -659,8 +659,8 @@ int __devinit dwc3_debugfs_init(struct dwc3 *dwc)
int ret;
root = debugfs_create_dir(dev_name(dwc->dev), NULL);
- if (IS_ERR(root)) {
- ret = PTR_ERR(root);
+ if (!root) {
+ ret = -ENOMEM;
goto err0;
}
@@ -668,29 +668,29 @@ int __devinit dwc3_debugfs_init(struct dwc3 *dwc)
file = debugfs_create_file("regdump", S_IRUGO, root, dwc,
&dwc3_regdump_fops);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
+ if (!file) {
+ ret = -ENOMEM;
goto err1;
}
file = debugfs_create_file("mode", S_IRUGO | S_IWUSR, root,
dwc, &dwc3_mode_fops);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
+ if (!file) {
+ ret = -ENOMEM;
goto err1;
}
file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root,
dwc, &dwc3_testmode_fops);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
+ if (!file) {
+ ret = -ENOMEM;
goto err1;
}
file = debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root,
dwc, &dwc3_link_state_fops);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
+ if (!file) {
+ ret = -ENOMEM;
goto err1;
}
OpenPOWER on IntegriCloud