Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/dsi: Add routine to unregister a DSI device

A driver calling mipi_dsi_device_register_full() might want to remove
the device once it's done. It might also require it in an error handling
path in case something went wrong.

Create mipi_dsi_device_unregister() for this purpose and use it within
mipi_dsi_remove_device_fn() as it does the same thing.

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Archit Taneja and committed by
Thierry Reding
509e42ce bf4363ce

+12 -1
+11 -1
drivers/gpu/drm/drm_mipi_dsi.c
··· 225 225 } 226 226 EXPORT_SYMBOL(mipi_dsi_device_register_full); 227 227 228 + /** 229 + * mipi_dsi_device_unregister - unregister MIPI DSI device 230 + * @dsi: DSI peripheral device 231 + */ 232 + void mipi_dsi_device_unregister(struct mipi_dsi_device *dsi) 233 + { 234 + device_unregister(&dsi->dev); 235 + } 236 + EXPORT_SYMBOL(mipi_dsi_device_unregister); 237 + 228 238 int mipi_dsi_host_register(struct mipi_dsi_host *host) 229 239 { 230 240 struct device_node *node; ··· 254 244 { 255 245 struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); 256 246 257 - device_unregister(&dsi->dev); 247 + mipi_dsi_device_unregister(dsi); 258 248 259 249 return 0; 260 250 }
+1
include/drm/drm_mipi_dsi.h
··· 210 210 struct mipi_dsi_device * 211 211 mipi_dsi_device_register_full(struct mipi_dsi_host *host, 212 212 const struct mipi_dsi_device_info *info); 213 + void mipi_dsi_device_unregister(struct mipi_dsi_device *dsi); 213 214 struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np); 214 215 int mipi_dsi_attach(struct mipi_dsi_device *dsi); 215 216 int mipi_dsi_detach(struct mipi_dsi_device *dsi);