From: Yang Yingliang Date: Mon, 22 Aug 2022 06:19:22 +0000 (+0800) Subject: class: use IS_ERR_OR_NULL() helper in class_unregister() X-Git-Tag: v6.6.17~6448^2~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9628e015fe205f10766f031f17e217f85650570;p=platform%2Fkernel%2Flinux-rpi.git class: use IS_ERR_OR_NULL() helper in class_unregister() Use IS_ERR_OR_NULL() helper in class_unregister() to simplify code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220822061922.3884113-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/class.c b/drivers/base/class.c index 8feb85e..64f7b9a 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);