@@ -57,14 +57,13 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
57
57
DRM_ERROR ("failed to map control registers area\n" );
58
58
ret = PTR_ERR (hdlcd -> mmio );
59
59
hdlcd -> mmio = NULL ;
60
- goto fail ;
60
+ return ret ;
61
61
}
62
62
63
63
version = hdlcd_read (hdlcd , HDLCD_REG_VERSION );
64
64
if ((version & HDLCD_PRODUCT_MASK ) != HDLCD_PRODUCT_ID ) {
65
65
DRM_ERROR ("unknown product id: 0x%x\n" , version );
66
- ret = - EINVAL ;
67
- goto fail ;
66
+ return - EINVAL ;
68
67
}
69
68
DRM_INFO ("found ARM HDLCD version r%dp%d\n" ,
70
69
(version & HDLCD_VERSION_MAJOR_MASK ) >> 8 ,
@@ -73,7 +72,7 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
73
72
/* Get the optional framebuffer memory resource */
74
73
ret = of_reserved_mem_device_init (drm -> dev );
75
74
if (ret && ret != - ENODEV )
76
- goto fail ;
75
+ return ret ;
77
76
78
77
ret = dma_set_mask_and_coherent (drm -> dev , DMA_BIT_MASK (32 ));
79
78
if (ret )
@@ -101,8 +100,6 @@ static int hdlcd_load(struct drm_device *drm, unsigned long flags)
101
100
drm_crtc_cleanup (& hdlcd -> crtc );
102
101
setup_fail :
103
102
of_reserved_mem_device_release (drm -> dev );
104
- fail :
105
- devm_clk_put (drm -> dev , hdlcd -> clk );
106
103
107
104
return ret ;
108
105
}
@@ -412,7 +409,6 @@ static int hdlcd_drm_bind(struct device *dev)
412
409
pm_runtime_put_sync (drm -> dev );
413
410
pm_runtime_disable (drm -> dev );
414
411
of_reserved_mem_device_release (drm -> dev );
415
- devm_clk_put (dev , hdlcd -> clk );
416
412
err_free :
417
413
drm_dev_unref (drm );
418
414
@@ -436,10 +432,6 @@ static void hdlcd_drm_unbind(struct device *dev)
436
432
pm_runtime_put_sync (drm -> dev );
437
433
pm_runtime_disable (drm -> dev );
438
434
of_reserved_mem_device_release (drm -> dev );
439
- if (!IS_ERR (hdlcd -> clk )) {
440
- devm_clk_put (drm -> dev , hdlcd -> clk );
441
- hdlcd -> clk = NULL ;
442
- }
443
435
drm_mode_config_cleanup (drm );
444
436
drm_dev_unregister (drm );
445
437
drm_dev_unref (drm );
0 commit comments