]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/gpu/drm/mediatek/mtk_drm_drv.c
Merge airlied/drm-next into drm-misc-next
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / mediatek / mtk_drm_drv.c
index b2596f35104b9c7edc2df395165c6bea8084e50f..c8163525d444f191e6fd7ffc9405850b1530b165 100644 (file)
@@ -443,11 +443,12 @@ static int mtk_drm_probe(struct platform_device *pdev)
                private->comp_node[comp_id] = of_node_get(node);
 
                /*
-                * Currently only the OVL, RDMA, DSI, and DPI blocks have
+                * Currently only the COLOR, OVL, RDMA, DSI, and DPI blocks have
                 * separate component platform drivers and initialize their own
                 * DDP component structure. The others are initialized here.
                 */
-               if (comp_type == MTK_DISP_OVL ||
+               if (comp_type == MTK_DISP_COLOR ||
+                   comp_type == MTK_DISP_OVL ||
                    comp_type == MTK_DISP_RDMA ||
                    comp_type == MTK_DSI ||
                    comp_type == MTK_DPI) {
@@ -570,6 +571,7 @@ static struct platform_driver mtk_drm_platform_driver = {
 
 static struct platform_driver * const mtk_drm_drivers[] = {
        &mtk_ddp_driver,
+       &mtk_disp_color_driver,
        &mtk_disp_ovl_driver,
        &mtk_disp_rdma_driver,
        &mtk_dpi_driver,
@@ -580,33 +582,14 @@ static struct platform_driver * const mtk_drm_drivers[] = {
 
 static int __init mtk_drm_init(void)
 {
-       int ret;
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(mtk_drm_drivers); i++) {
-               ret = platform_driver_register(mtk_drm_drivers[i]);
-               if (ret < 0) {
-                       pr_err("Failed to register %s driver: %d\n",
-                              mtk_drm_drivers[i]->driver.name, ret);
-                       goto err;
-               }
-       }
-
-       return 0;
-
-err:
-       while (--i >= 0)
-               platform_driver_unregister(mtk_drm_drivers[i]);
-
-       return ret;
+       return platform_register_drivers(mtk_drm_drivers,
+                                        ARRAY_SIZE(mtk_drm_drivers));
 }
 
 static void __exit mtk_drm_exit(void)
 {
-       int i;
-
-       for (i = ARRAY_SIZE(mtk_drm_drivers) - 1; i >= 0; i--)
-               platform_driver_unregister(mtk_drm_drivers[i]);
+       platform_unregister_drivers(mtk_drm_drivers,
+                                   ARRAY_SIZE(mtk_drm_drivers));
 }
 
 module_init(mtk_drm_init);