[v3,2/4] drm/panel: boe-tv101wum-nl6: Drop surplus prepare tracking

Message ID 20230703-fix-boe-tv101wum-nl6-v3-2-bd6e9432c755@linaro.org
State New
Headers
Series Fix up the boe-tv101wum-nl6 panel driver |

Commit Message

Linus Walleij July 3, 2023, 1:21 p.m. UTC
  The DRM panel core already keeps track of if the panel is already
prepared so do not reimplement this.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 12 ------------
 1 file changed, 12 deletions(-)
  

Comments

Doug Anderson July 6, 2023, 9:11 p.m. UTC | #1
Hi,

On Mon, Jul 3, 2023 at 6:22 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> The DRM panel core already keeps track of if the panel is already
> prepared so do not reimplement this.
>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 12 ------------
>  1 file changed, 12 deletions(-)

It does? Can you please point to where/when the DRM panel core keeps
track of this? I know I've posted a patch for this at:

https://lore.kernel.org/r/20230607144931.v2.2.I59b417d4c29151cc2eff053369ec4822b606f375@changeid

...but I haven't landed it because I'm still trying to get consensus
on the rest of the series and a later patch in the series depends on
it.

If you have some evidence that my patch isn't needed, can you please
point at it in the commit message? I would say at least that someone
else seemed to agree that the core wasn't checking this [1], though I
guess it's possible that person was running old code or was just as
confused as I was.

[1] https://lore.kernel.org/r/646e391f.810a0220.214ce.d680@mx.google.com

-Doug
  

Patch

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 6fd4c9507c88..358918e0f03f 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -51,8 +51,6 @@  struct boe_panel {
 	struct regulator *avee;
 	struct regulator *avdd;
 	struct gpio_desc *enable_gpio;
-
-	bool prepared;
 };
 
 static int boe_tv110c9m_init(struct mipi_dsi_device *dsi)
@@ -1748,9 +1746,6 @@  static int boe_panel_unprepare(struct drm_panel *panel)
 {
 	struct boe_panel *boe = to_boe_panel(panel);
 
-	if (!boe->prepared)
-		return 0;
-
 	if (boe->desc->discharge_on_disable) {
 		regulator_disable(boe->avee);
 		regulator_disable(boe->avdd);
@@ -1769,8 +1764,6 @@  static int boe_panel_unprepare(struct drm_panel *panel)
 		regulator_disable(boe->pp3300);
 	}
 
-	boe->prepared = false;
-
 	return 0;
 }
 
@@ -1779,9 +1772,6 @@  static int boe_panel_prepare(struct drm_panel *panel)
 	struct boe_panel *boe = to_boe_panel(panel);
 	int ret;
 
-	if (boe->prepared)
-		return 0;
-
 	gpiod_set_value(boe->enable_gpio, 0);
 	usleep_range(1000, 1500);
 
@@ -1823,8 +1813,6 @@  static int boe_panel_prepare(struct drm_panel *panel)
 		}
 	}
 
-	boe->prepared = true;
-
 	return 0;
 
 poweroff: