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 <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220822061922.3884113-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yang Yingliang 2022-08-22 14:19:22 +08:00 committed by Greg Kroah-Hartman
parent 07b7b883be
commit e9628e015f

View file

@ -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);