b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -662,16 +662,11 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
if (node) {
struct device_node *core_node;
- int i;
- for (i = 0; ; i++) {
- core_node = of_parse_phandle(node, "cores", i);
- if (!core_node)
- break;
-
- drm_of_component_match_add(&pdev->dev, &match,
- compare_of, core_node);
- of_node_put(core_node);
+ for_each_compatible_node(core_node, NULL, "vivante,gc") {
+ if (of_device_is_available(core_node))
+ drm_of_component_match_add(&pdev->dev, &match,
+ compare_of, core_node);
}
} else if (dev->platform_data) {
char **names = dev->platform_data;
@@ -691,28 +686,27 @@ static int etnaviv_pdev_remove(struct platform_device *pdev)
return 0;
}
-static const struct of_device_id dt_match[] = {
- { .compatible = "fsl,imx-gpu-subsystem" },
- { .compatible = "marvell,dove-gpu-subsystem" },
- {}
-};
-MODULE_DEVICE_TABLE(of, dt_match);
-
static struct platform_driver etnaviv_platform_driver = {
.probe = etnaviv_pdev_probe,
.remove = etnaviv_pdev_remove,
.driver = {
.name = "etnaviv",
- .of_match_table = dt_match,
},
};
static int __init etnaviv_init(void)
{
int ret;
+ struct device_node *node;
etnaviv_validate_init();
+ node = of_find_compatible_node(NULL, "vivante,gc");
+ if (node && of_device_is_available(node)) {
+ platform_device_register_simple("etnaviv", -1, NULL, 0);
+ of_node_put(node);
+ }
+
ret = platform_driver_register(&etnaviv_gpu_driver);
if (ret != 0)
return ret;