[PATCH -next] class: use IS_ERR_OR_NULL() helper in class_unregister()
From: Yang Yingliang
Date: Mon Aug 22 2022 - 02:11:36 EST
Use IS_ERR_OR_NULL() helper in class_unregister() to simplify code.
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
drivers/base/class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 8feb85e186e3..64f7b9a0970f 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -260,7 +260,7 @@ EXPORT_SYMBOL_GPL(__class_create);
*/
void class_destroy(struct class *cls)
{
- if ((cls == NULL) || (IS_ERR(cls)))
+ if (IS_ERR_OR_NULL(cls))
return;
class_unregister(cls);
--
2.25.1