diff options
author | Douglas Anderson <dianders@chromium.org> | 2023-08-05 00:06:04 +0300 |
---|---|---|
committer | Douglas Anderson <dianders@chromium.org> | 2023-09-13 18:36:18 +0300 |
commit | f8c37b88092e12157b2b707f1a83684b0b97b68e (patch) | |
tree | 6d9a3470701604ea0097b42ac445e8966498c44c /drivers/gpu/drm/panel/panel-novatek-nt35950.c | |
parent | 8569c31545385195bdb0c021124e68336e91c693 (diff) | |
download | linux-f8c37b88092e12157b2b707f1a83684b0b97b68e.tar.xz |
drm/panel: Don't store+check prepared/enabled for simple cases
As talked about in commit d2aacaf07395 ("drm/panel: Check for already
prepared/enabled in drm_panel"), we want to remove needless code from
panel drivers that was storing and double-checking the
prepared/enabled state. Even if someone was relying on the
double-check before, that double-check is now in the core and not
needed in individual drivers.
This pile of panel drivers appears to be simple to handle. Based on
code inspection they seemed to be using the prepared/enabled state
simply for double-checking that nothing else in the kernel called them
inconsistently. Now that the core drm_panel is doing the double
checking (and warning) it should be very clear that these devices
don't need their own double-check.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230804140605.RFC.1.Ia54954fd2f7645c1b86597494902973f57feeb71@changeid
Diffstat (limited to 'drivers/gpu/drm/panel/panel-novatek-nt35950.c')
-rw-r--r-- | drivers/gpu/drm/panel/panel-novatek-nt35950.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c index 412ca84d0581..648ce9201426 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c @@ -59,7 +59,6 @@ struct nt35950 { int cur_mode; u8 last_page; - bool prepared; }; struct nt35950_panel_mode { @@ -431,9 +430,6 @@ static int nt35950_prepare(struct drm_panel *panel) struct device *dev = &nt->dsi[0]->dev; int ret; - if (nt->prepared) - return 0; - ret = regulator_enable(nt->vregs[0].consumer); if (ret) return ret; @@ -460,7 +456,6 @@ static int nt35950_prepare(struct drm_panel *panel) dev_err(dev, "Failed to initialize panel: %d\n", ret); goto end; } - nt->prepared = true; end: if (ret < 0) { @@ -477,9 +472,6 @@ static int nt35950_unprepare(struct drm_panel *panel) struct device *dev = &nt->dsi[0]->dev; int ret; - if (!nt->prepared) - return 0; - ret = nt35950_off(nt); if (ret < 0) dev_err(dev, "Failed to deinitialize panel: %d\n", ret); @@ -487,7 +479,6 @@ static int nt35950_unprepare(struct drm_panel *panel) gpiod_set_value_cansleep(nt->reset_gpio, 0); regulator_bulk_disable(ARRAY_SIZE(nt->vregs), nt->vregs); - nt->prepared = false; return 0; } |