Commit e9628e01 authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

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: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220822061922.3884113-1-yangyingliang@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 07b7b883
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);