summaryrefslogtreecommitdiff
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-09-14 17:07:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-24 16:00:38 +0300
commitd70590d53a8996acf55426ba934d49eee9f091cd (patch)
tree62a28c727b513f4c4d646fb0851a384427aa8359 /drivers/base/core.c
parent21760e5c3829ed093953b990681aa1ba1b86ad31 (diff)
downloadlinux-d70590d53a8996acf55426ba934d49eee9f091cd.tar.xz
driver core: use IS_ERR_OR_NULL() helper in device_create_groups_vargs()
Use IS_ERR_OR_NULL() helper in device_create_groups_vargs() to simplify code and improve readiblity. No functional change. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220914140753.3799982-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index e16840886f14..d02501933467 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4170,7 +4170,7 @@ device_create_groups_vargs(struct class *class, struct device *parent,
struct device *dev = NULL;
int retval = -ENODEV;
- if (class == NULL || IS_ERR(class))
+ if (IS_ERR_OR_NULL(class))
goto error;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);