]> Git Repo - linux.git/commit
drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop
authorDouglas Anderson <[email protected]>
Fri, 1 Sep 2023 23:39:52 +0000 (16:39 -0700)
committerDouglas Anderson <[email protected]>
Wed, 13 Sep 2023 15:36:18 +0000 (08:36 -0700)
commit2a073968289d3e60d9262a12d5dec71725787b2d
treecb6f83f0248a8761dd554279a0a11be2194cb94e
parent92e62478b62cac25ff9f29bd314b0e03adb86699
drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop

As with other places in the Linux kernel--kfree(NULL) being the most
famous example--it's convenient to treat being passed a NULL argument
as a noop in cleanup functions. Let's make
drm_atomic_helper_shutdown() work like this.

This is convenient for DRM devices that use the "component" model. On
these devices we want shutdown to be a noop if the bind() call of the
component hasn't been called yet. As long as drivers are careful to
make sure the drvdata is NULL whenever the driver is not bound then we
can just do a simple call to drm_atomic_helper_shutdown() with the
drvdata at shutdown time.

Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.1.I906acd535bece03b6671d97c2826c6f0444f4728@changeid
drivers/gpu/drm/drm_atomic_helper.c
This page took 0.055869 seconds and 4 git commands to generate.