@@ -289,7 +289,6 @@ static const struct drm_plane_helper_funcs hdlcd_plane_helper_funcs = {
289
289
static const struct drm_plane_funcs hdlcd_plane_funcs = {
290
290
.update_plane = drm_atomic_helper_update_plane ,
291
291
.disable_plane = drm_atomic_helper_disable_plane ,
292
- .destroy = drm_plane_cleanup ,
293
292
.reset = drm_atomic_helper_plane_reset ,
294
293
.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state ,
295
294
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state ,
@@ -300,21 +299,16 @@ static struct drm_plane *hdlcd_plane_init(struct drm_device *drm)
300
299
struct hdlcd_drm_private * hdlcd = drm_to_hdlcd_priv (drm );
301
300
struct drm_plane * plane = NULL ;
302
301
u32 formats [ARRAY_SIZE (supported_formats )], i ;
303
- int ret ;
304
-
305
- plane = devm_kzalloc (drm -> dev , sizeof (* plane ), GFP_KERNEL );
306
- if (!plane )
307
- return ERR_PTR (- ENOMEM );
308
302
309
303
for (i = 0 ; i < ARRAY_SIZE (supported_formats ); i ++ )
310
304
formats [i ] = supported_formats [i ].fourcc ;
311
305
312
- ret = drm_universal_plane_init (drm , plane , 0xff , & hdlcd_plane_funcs ,
313
- formats , ARRAY_SIZE ( formats ) ,
314
- NULL ,
315
- DRM_PLANE_TYPE_PRIMARY , NULL );
316
- if (ret )
317
- return ERR_PTR ( ret ) ;
306
+ plane = drmm_universal_plane_alloc (drm , struct drm_plane , dev , 0xff ,
307
+ & hdlcd_plane_funcs ,
308
+ formats , ARRAY_SIZE ( formats ) ,
309
+ NULL , DRM_PLANE_TYPE_PRIMARY , NULL );
310
+ if (IS_ERR ( plane ) )
311
+ return plane ;
318
312
319
313
drm_plane_helper_add (plane , & hdlcd_plane_helper_funcs );
320
314
hdlcd -> plane = plane ;
0 commit comments