summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/pl111/pl111_versatile.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2020-04-02 20:34:25 +0300
committerRob Herring <robh@kernel.org>2020-04-28 22:06:20 +0300
commitcbcab504ceecc0b27ab829cbbcd5cad1c17b3975 (patch)
tree720caa520a87498b78a0e5f5f089ba1a7dfeaece /drivers/gpu/drm/pl111/pl111_versatile.c
parent66ddc1e94114d0271910ed31af6c301a281c9260 (diff)
downloadlinux-cbcab504ceecc0b27ab829cbbcd5cad1c17b3975.tar.xz
drm: pl111: Simplify vexpress init
The init VExpress variants currently instantiates a 'muxfpga' driver for the sole purpose of getting a regmap for it. There's no reason to instantiate a driver and doing so just complicates things. The muxfpga driver also isn't unregistered properly on module unload. Let's just simplify all this this by just calling devm_regmap_init_vexpress_config() directly. Cc: Eric Anholt <eric@anholt.net> Cc: dri-devel@lists.freedesktop.org Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200409013947.12667-3-robh@kernel.org
Diffstat (limited to 'drivers/gpu/drm/pl111/pl111_versatile.c')
-rw-r--r--drivers/gpu/drm/pl111/pl111_versatile.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c
index 4f325c410b5d..f891f9bf3a93 100644
--- a/drivers/gpu/drm/pl111/pl111_versatile.c
+++ b/drivers/gpu/drm/pl111/pl111_versatile.c
@@ -8,6 +8,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/regmap.h>
+#include <linux/vexpress.h>
#include "pl111_versatile.h"
#include "pl111_vexpress.h"
@@ -391,17 +392,8 @@ int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)
}
/* Versatile Express special handling */
- if (versatile_clcd_type == VEXPRESS_CLCD_V2M) {
+ if (IS_ENABLED(CONFIG_VEXPRESS_CONFIG) && versatile_clcd_type == VEXPRESS_CLCD_V2M) {
struct platform_device *pdev;
-
- /* Registers a driver for the muxfpga */
- ret = vexpress_muxfpga_init();
- if (ret) {
- dev_err(dev, "unable to initialize muxfpga driver\n");
- of_node_put(np);
- return ret;
- }
-
/* Call into deep Vexpress configuration API */
pdev = of_find_device_by_node(np);
if (!pdev) {
@@ -409,13 +401,8 @@ int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)
of_node_put(np);
return -EPROBE_DEFER;
}
- map = dev_get_drvdata(&pdev->dev);
- if (!map) {
- dev_err(dev, "sysreg has not yet probed\n");
- platform_device_put(pdev);
- of_node_put(np);
- return -EPROBE_DEFER;
- }
+ map = devm_regmap_init_vexpress_config(&pdev->dev);
+ platform_device_put(pdev);
} else {
map = syscon_node_to_regmap(np);
}