mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 22:53:55 +08:00
drm: simplify drm_sysfs_destroy() via IS_ERR_OR_NULL()
Simplify `foo == NULL || IS_ERR(foo)` via IS_ERR_OR_NULL(). This is pretty commonly used all over the kernel, especially for debugfs/sysfs cleanup paths. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
3a818d350f
commit
26b91ae473
@ -156,7 +156,7 @@ err_out:
|
|||||||
*/
|
*/
|
||||||
void drm_sysfs_destroy(void)
|
void drm_sysfs_destroy(void)
|
||||||
{
|
{
|
||||||
if ((drm_class == NULL) || (IS_ERR(drm_class)))
|
if (IS_ERR_OR_NULL(drm_class))
|
||||||
return;
|
return;
|
||||||
class_remove_file(drm_class, &class_attr_version.attr);
|
class_remove_file(drm_class, &class_attr_version.attr);
|
||||||
class_destroy(drm_class);
|
class_destroy(drm_class);
|
||||||
|
Loading…
Reference in New Issue
Block a user