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:
parent
07b7b883be
commit
e9628e015f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user