@@ -121,6 +121,8 @@ static const struct mtk_mmsys_driver_data mt8365_mmsys_driver_data = {
121
121
struct mtk_mmsys {
122
122
void __iomem * regs ;
123
123
const struct mtk_mmsys_driver_data * data ;
124
+ struct platform_device * clks_pdev ;
125
+ struct platform_device * drm_pdev ;
124
126
spinlock_t lock ; /* protects mmsys_sw_rst_b reg */
125
127
struct reset_controller_dev rcdev ;
126
128
struct cmdq_client_reg cmdq_base ;
@@ -386,6 +388,7 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
386
388
PLATFORM_DEVID_AUTO , NULL , 0 );
387
389
if (IS_ERR (clks ))
388
390
return PTR_ERR (clks );
391
+ mmsys -> clks_pdev = clks ;
389
392
390
393
if (mmsys -> data -> is_vppsys )
391
394
goto out_probe_done ;
@@ -396,11 +399,22 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
396
399
platform_device_unregister (clks );
397
400
return PTR_ERR (drm );
398
401
}
402
+ mmsys -> drm_pdev = drm ;
399
403
400
404
out_probe_done :
401
405
return 0 ;
402
406
}
403
407
408
+ static int mtk_mmsys_remove (struct platform_device * pdev )
409
+ {
410
+ struct mtk_mmsys * mmsys = platform_get_drvdata (pdev );
411
+
412
+ platform_device_unregister (mmsys -> drm_pdev );
413
+ platform_device_unregister (mmsys -> clks_pdev );
414
+
415
+ return 0 ;
416
+ }
417
+
404
418
static const struct of_device_id of_match_mtk_mmsys [] = {
405
419
{
406
420
.compatible = "mediatek,mt2701-mmsys" ,
@@ -475,6 +489,7 @@ static struct platform_driver mtk_mmsys_drv = {
475
489
.of_match_table = of_match_mtk_mmsys ,
476
490
},
477
491
.probe = mtk_mmsys_probe ,
492
+ .remove = mtk_mmsys_remove ,
478
493
};
479
494
480
495
static int __init mtk_mmsys_init (void )
0 commit comments