summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/sco.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-18 02:24:16 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-18 09:45:19 +0200
commit1120e4bfa5f9c28cb55d815ab3c6bed81dfc595c (patch)
tree0a24ba3d546bf60ea51a022028f66747b0829996 /net/bluetooth/sco.c
parentBluetooth: Move uuids debugfs entry creation into hci_core.c (diff)
downloadlinux-1120e4bfa5f9c28cb55d815ab3c6bed81dfc595c.tar.xz
linux-1120e4bfa5f9c28cb55d815ab3c6bed81dfc595c.zip
Bluetooth: Use IS_ERR_OR_NULL for checking bt_debugfs
Make sure to use IS_ERR_OR_NULL for checking the existing of the root debugfs dentry bt_debugfs. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r--net/bluetooth/sco.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index a92aebac56ca..12a0e51e21e1 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -1177,15 +1177,14 @@ int __init sco_init(void)
goto error;
}
- if (bt_debugfs) {
- sco_debugfs = debugfs_create_file("sco", 0444, bt_debugfs,
- NULL, &sco_debugfs_fops);
- if (!sco_debugfs)
- BT_ERR("Failed to create SCO debug file");
- }
-
BT_INFO("SCO socket layer initialized");
+ if (IS_ERR_OR_NULL(bt_debugfs))
+ return 0;
+
+ sco_debugfs = debugfs_create_file("sco", 0444, bt_debugfs,
+ NULL, &sco_debugfs_fops);
+
return 0;
error: