mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
drm/mipi-dbi: Drop explicit drm_mode_config_cleanup call
Allows us to drop the drm_driver.release callback from all drivers, and remove the mipi_dbi_release() function. This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Noralf Trønnes <noralf@tronnes.org> (v2) Tested-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Eric Anholt <eric@anholt.net> Cc: David Lechner <david@lechnology.com> Cc: Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-49-daniel.vetter@ffwll.ch
This commit is contained in:
parent
53bdebf7fe
commit
3421a6c409
@ -511,7 +511,7 @@ int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev,
|
||||
if (!dbidev->dbi.command)
|
||||
return -EINVAL;
|
||||
|
||||
ret = drm_mode_config_init(drm);
|
||||
ret = drmm_mode_config_init(drm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -583,22 +583,6 @@ int mipi_dbi_dev_init(struct mipi_dbi_dev *dbidev,
|
||||
}
|
||||
EXPORT_SYMBOL(mipi_dbi_dev_init);
|
||||
|
||||
/**
|
||||
* mipi_dbi_release - DRM driver release helper
|
||||
* @drm: DRM device
|
||||
*
|
||||
* This function finalizes and frees &mipi_dbi.
|
||||
*
|
||||
* Drivers can use this as their &drm_driver->release callback.
|
||||
*/
|
||||
void mipi_dbi_release(struct drm_device *drm)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("\n");
|
||||
|
||||
drm_mode_config_cleanup(drm);
|
||||
}
|
||||
EXPORT_SYMBOL(mipi_dbi_release);
|
||||
|
||||
/**
|
||||
* mipi_dbi_hw_reset - Hardware reset of controller
|
||||
* @dbi: MIPI DBI structure
|
||||
|
@ -196,7 +196,6 @@ DEFINE_DRM_GEM_CMA_FOPS(hx8357d_fops);
|
||||
static struct drm_driver hx8357d_driver = {
|
||||
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
||||
.fops = &hx8357d_fops,
|
||||
.release = mipi_dbi_release,
|
||||
DRM_GEM_CMA_VMAP_DRIVER_OPS,
|
||||
.debugfs_init = mipi_dbi_debugfs_init,
|
||||
.name = "hx8357d",
|
||||
|
@ -346,7 +346,6 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9225_fops);
|
||||
static struct drm_driver ili9225_driver = {
|
||||
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
||||
.fops = &ili9225_fops,
|
||||
.release = mipi_dbi_release,
|
||||
DRM_GEM_CMA_VMAP_DRIVER_OPS,
|
||||
.name = "ili9225",
|
||||
.desc = "Ilitek ILI9225",
|
||||
|
@ -152,7 +152,6 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops);
|
||||
static struct drm_driver ili9341_driver = {
|
||||
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
||||
.fops = &ili9341_fops,
|
||||
.release = mipi_dbi_release,
|
||||
DRM_GEM_CMA_VMAP_DRIVER_OPS,
|
||||
.debugfs_init = mipi_dbi_debugfs_init,
|
||||
.name = "ili9341",
|
||||
|
@ -165,7 +165,6 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9486_fops);
|
||||
static struct drm_driver ili9486_driver = {
|
||||
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
||||
.fops = &ili9486_fops,
|
||||
.release = mipi_dbi_release,
|
||||
DRM_GEM_CMA_VMAP_DRIVER_OPS,
|
||||
.debugfs_init = mipi_dbi_debugfs_init,
|
||||
.name = "ili9486",
|
||||
|
@ -156,7 +156,6 @@ DEFINE_DRM_GEM_CMA_FOPS(mi0283qt_fops);
|
||||
static struct drm_driver mi0283qt_driver = {
|
||||
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
||||
.fops = &mi0283qt_fops,
|
||||
.release = mipi_dbi_release,
|
||||
DRM_GEM_CMA_VMAP_DRIVER_OPS,
|
||||
.debugfs_init = mipi_dbi_debugfs_init,
|
||||
.name = "mi0283qt",
|
||||
|
@ -285,7 +285,6 @@ DEFINE_DRM_GEM_CMA_FOPS(st7586_fops);
|
||||
static struct drm_driver st7586_driver = {
|
||||
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
||||
.fops = &st7586_fops,
|
||||
.release = mipi_dbi_release,
|
||||
DRM_GEM_CMA_VMAP_DRIVER_OPS,
|
||||
.debugfs_init = mipi_dbi_debugfs_init,
|
||||
.name = "st7586",
|
||||
|
@ -157,7 +157,6 @@ DEFINE_DRM_GEM_CMA_FOPS(st7735r_fops);
|
||||
static struct drm_driver st7735r_driver = {
|
||||
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
|
||||
.fops = &st7735r_fops,
|
||||
.release = mipi_dbi_release,
|
||||
DRM_GEM_CMA_VMAP_DRIVER_OPS,
|
||||
.debugfs_init = mipi_dbi_debugfs_init,
|
||||
.name = "st7735r",
|
||||
|
@ -152,7 +152,6 @@ int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev,
|
||||
int mipi_dbi_dev_init(struct mipi_dbi_dev *dbidev,
|
||||
const struct drm_simple_display_pipe_funcs *funcs,
|
||||
const struct drm_display_mode *mode, unsigned int rotation);
|
||||
void mipi_dbi_release(struct drm_device *drm);
|
||||
void mipi_dbi_pipe_update(struct drm_simple_display_pipe *pipe,
|
||||
struct drm_plane_state *old_state);
|
||||
void mipi_dbi_enable_flush(struct mipi_dbi_dev *dbidev,
|
||||
|
Loading…
Reference in New Issue
Block a user