drm/mipi-dsi: Detach devices when removing the host
authorMaxime Ripard <maxime@cerno.tech>
Mon, 11 Jul 2022 17:38:31 +0000 (19:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:17:01 +0000 (13:17 +0200)
commit262364574b05676d4b9ebde2ddd3588cd2efd8ce
treea0aa4491dd43e3caea2f330aa73ea0e042c93ff7
parentf63e896e78c247d0be8165d99d543a28ca0be360
drm/mipi-dsi: Detach devices when removing the host

[ Upstream commit 668a8f17b5290d04ef7343636a5588a0692731a1 ]

Whenever the MIPI-DSI host is unregistered, the code of
mipi_dsi_host_unregister() loops over every device currently found on that
bus and will unregister it.

However, it doesn't detach it from the bus first, which leads to all kind
of resource leaks if the host wants to perform some clean up whenever a
device is detached.

Fixes: 068a00233969 ("drm: Add MIPI DSI bus support")
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220711173939.1132294-2-maxime@cerno.tech
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/drm_mipi_dsi.c