[PATCH -next] driver core: use IS_ERR_OR_NULL() helper in device_create_groups_vargs()
From: Yang Yingliang
Date: Wed Sep 14 2022 - 10:02:23 EST
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@xxxxxxxxxx>
---
drivers/base/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 753e7cca0f40..91ba46811f67 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);
--
2.25.1