Skip to contentSkip to conversation

driver core: use IS_ERR_OR_NULL() helper in device_create_groups_vargs()

PATCH New Yang Yingliang 1 participant 1 message Sep 14, 2022 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/base/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/core.c +1 -1
index 753e7cca0f40..91ba46811f67 100644
@@ -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);
Signature · 1 line
2.25.1