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

Configure Feed

Select the types of activity you want to include in your feed.

drm/atmel-hlcdc: use drmm_universal_plane_alloc()

Use the drmm_universal_plane_alloc() helper to simplify the code. Using
it, we no longer need to register the destroy callback for
drm_plane_funcs.

Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Link: https://patch.msgid.link/20251218-lcd_cleanup_mainline-v2-7-df837aba878f@microchip.com
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>

authored by

Ludovic Desroches and committed by
Manikandan Muralidharan
4bad57c2 d8a29980

+7 -14
+7 -14
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
··· 1225 1225 static const struct drm_plane_funcs layer_plane_funcs = { 1226 1226 .update_plane = drm_atomic_helper_update_plane, 1227 1227 .disable_plane = drm_atomic_helper_disable_plane, 1228 - .destroy = drm_plane_cleanup, 1229 1228 .reset = atmel_hlcdc_plane_reset, 1230 1229 .atomic_duplicate_state = atmel_hlcdc_plane_atomic_duplicate_state, 1231 1230 .atomic_destroy_state = atmel_hlcdc_plane_atomic_destroy_state, ··· 1238 1239 enum drm_plane_type type; 1239 1240 int ret; 1240 1241 1241 - plane = devm_kzalloc(dev->dev, sizeof(*plane), GFP_KERNEL); 1242 - if (!plane) 1243 - return -ENOMEM; 1244 - 1245 - atmel_hlcdc_layer_init(&plane->layer, desc, dc->hlcdc->regmap); 1246 - 1247 1242 if (desc->type == ATMEL_HLCDC_BASE_LAYER) 1248 1243 type = DRM_PLANE_TYPE_PRIMARY; 1249 1244 else if (desc->type == ATMEL_HLCDC_CURSOR_LAYER) ··· 1245 1252 else 1246 1253 type = DRM_PLANE_TYPE_OVERLAY; 1247 1254 1248 - ret = drm_universal_plane_init(dev, &plane->base, 0, 1249 - &layer_plane_funcs, 1250 - desc->formats->formats, 1251 - desc->formats->nformats, 1252 - NULL, type, NULL); 1253 - if (ret) 1254 - return ret; 1255 + plane = drmm_universal_plane_alloc(dev, struct atmel_hlcdc_plane, base, 0, 1256 + &layer_plane_funcs, desc->formats->formats, 1257 + desc->formats->nformats, NULL, type, NULL); 1258 + if (IS_ERR(plane)) 1259 + return PTR_ERR(plane); 1260 + 1261 + atmel_hlcdc_layer_init(&plane->layer, desc, dc->hlcdc->regmap); 1255 1262 1256 1263 drm_plane_helper_add(&plane->base, 1257 1264 &atmel_hlcdc_layer_plane_helper_funcs);