Commit 7512cc0f authored by Douglas Anderson's avatar Douglas Anderson Committed by Wojciech Macek
Browse files

UPSTREAM: 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: default avatarMaxime Ripard <mripard@kernel.org>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.1.I906acd535bece03b6671d97c2826c6f0444f4728@changeid



(cherry picked from commit 2a073968)

Bug: 376202899
Test: shutdown Corsola
Change-Id: I9c66bd087d92125414a09cea391a634943cbc213
Signed-off-by: default avatarWojciech Macek <wmacek@google.com>
parent c9272c37
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment