Skip to content

Commit

Permalink
driver core: use IS_ERR_OR_NULL() helper in device_create_groups_vargs()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yang Yingliang authored and Greg Kroah-Hartman committed Sep 24, 2022
1 parent 21760e5 commit d70590d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d70590d

Please sign in to comment.