Commit d70590d5 authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman

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: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220914140753.3799982-1-yangyingliang@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 21760e5c
...@@ -4170,7 +4170,7 @@ device_create_groups_vargs(struct class *class, struct device *parent, ...@@ -4170,7 +4170,7 @@ device_create_groups_vargs(struct class *class, struct device *parent,
struct device *dev = NULL; struct device *dev = NULL;
int retval = -ENODEV; int retval = -ENODEV;
if (class == NULL || IS_ERR(class)) if (IS_ERR_OR_NULL(class))
goto error; goto error;
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment