Skip to content

Commit

Permalink
drm/mipi-dsi: move to_mipi_dsi_device() to use container_of_const()
Browse files Browse the repository at this point in the history
The driver core is changing to pass some pointers as const, so move
to_mipi_dsi_device() to use container_of_const() to handle this change.

to_mipi_dsi_device() now properly keeps the const-ness of the pointer passed
into it, while as before it could be lost.

Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh authored and junxiaoc committed Jul 18, 2023
1 parent 4f8e0e8 commit f1d7912
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/drm/drm_mipi_dsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,7 @@ struct mipi_dsi_device {

#define MIPI_DSI_MODULE_PREFIX "mipi-dsi:"

static inline struct mipi_dsi_device *to_mipi_dsi_device(struct device *dev)
{
return container_of(dev, struct mipi_dsi_device, dev);
}
#define to_mipi_dsi_device(__dev) container_of_const(__dev, struct mipi_dsi_device, dev)

/**
* mipi_dsi_pixel_format_to_bpp - obtain the number of bits per pixel for any
Expand Down

0 comments on commit f1d7912

Please sign in to comment.