Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp432768rwb; Fri, 4 Aug 2023 15:32:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDyzKzVJNt8Az4SmO+tCapqZUSZP3DOvl9YL999HMrE5QpRZOuEtLwDhHXJNisepW1RgFw X-Received: by 2002:a17:903:2312:b0:1bb:98ef:4b2b with SMTP id d18-20020a170903231200b001bb98ef4b2bmr2675580plh.16.1691188334173; Fri, 04 Aug 2023 15:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691188334; cv=none; d=google.com; s=arc-20160816; b=uoO7Y9pWVRvDR2r6M6ZstKs8LEYK0pw+dwf5wScmKf54lUxaXeawdsucNFlF8E3SUV Bpp+G6ehKzwqpEPOC2cZj5ur8WrQiPZQ6bAQCRxIJ/a17UTNsn0o9g8Jp83mkjw+OwB7 /asUqCrYvR5KXRLGr5hXEZPQ3cOJL6V7Aqt4U3VdV3Z27wqezw5fvcwFYTcc4VThPoNx EvgGwYu+iwqiO5pu3wdfS++6WLwb597BBb2MSnDOKyg57Ybvujskwk/2IF0joIcL9y3S 4WKTBLUavcsncnHwE/nOXqIgFaXNxAiiVjEU4QCC5O3fIrselKUqJ3QT//zgrEGY6P5s SEMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+K4pAadzRZN083YWndwfDzadQIgjy+stzVGii5iIJGU=; fh=dprmmFr5kEs2oaIKuWw0OlwhpcBwFTafCHELzUCPXiw=; b=NI0HmccuMiSJQ3Q9QLOsD3/5I2FXDMZ0ZVbCNZK/nZ93aqWY1LHh7kh/287OOsE+Y2 Fzl2zDMibWhihavO+8ajhR23cKAe1vlyXPeDM8Jv7d9frtfo6b0swcn/Vg4MudmQe3Ya KsXGicG0TlhTzt1NBUsqnFlSXYMKM0c8P1K1urpL8AGqjx2ywAskkD31kWFw6awPNga9 3PaqepFO7wcFtKyVy5ZRr+GAqHYZYq1qm7ek+HBOolx749/dYtzLvDTdVjTleJAUZrrG 3sPr6q+szsi00TJG9wLNkr20/FMH8Zl3pmIEFqong3SX16djRiVjdwu/yQJyGZljpI49 lfkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T1UYVJsN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lh7-20020a170903290700b001b9ca3e0388si140095plb.584.2023.08.04.15.31.58; Fri, 04 Aug 2023 15:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T1UYVJsN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230321AbjHDVIf (ORCPT + 99 others); Fri, 4 Aug 2023 17:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231146AbjHDVIH (ORCPT ); Fri, 4 Aug 2023 17:08:07 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90D1E559E for ; Fri, 4 Aug 2023 14:07:18 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-686f090310dso2442063b3a.0 for ; Fri, 04 Aug 2023 14:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691183237; x=1691788037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+K4pAadzRZN083YWndwfDzadQIgjy+stzVGii5iIJGU=; b=T1UYVJsN721ozkISMV86q9Yazgfhma0y3bUeJgLTkokFM2FXoQfsXSElONE+8QorfW 6KJCMyYa6HwgGob86Pamhm3mAAKLOuEG/C24hVShpaprAQaj9ga275WVxyVBsuNTp4Xq 4YsIw1eOx9vVerNFIlXmAaIu6WLUGVO5/Ovsk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691183237; x=1691788037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+K4pAadzRZN083YWndwfDzadQIgjy+stzVGii5iIJGU=; b=kWaxTDyHtCTTLteBhMDbTbBTzVLB1/vedAyePrz3q11FIRLR4QJiZOnyyCSl/ydM7c 05tOm0JijHFtB9w44cPcj0IRkrVRRkgjjWm4H7/CdNftYVFbp+J5Xt8wtlnPsJO/LxZg 0Hm2swsKfSt3xYAGjFrxLGXM9+qVAC87JO/OPptwaEufiw3Cb/g0aV/38SF7KxWolK9w FR/ryZxbI6l+EErfrzRtqWbWul3HSi/rXWu4swBJ7HT/dKIUTBGXjopKjDFQyOuKH3eR D8foJ3U9sQrCzBtomsMF1nUoO3t4jP+NeXkM9fSGOA+epzftQ02RJk6cwKbqnENcL13v zbAg== X-Gm-Message-State: AOJu0YxpBjoaMkxq8cirCi/Fw1cwucTcOyC8MSI3K5iSI7J+mNvRwBLu s1wjsT34jxk69q0nhqGsUWxCxw== X-Received: by 2002:a05:6a21:7189:b0:133:f860:ac42 with SMTP id wq9-20020a056a21718900b00133f860ac42mr3100626pzb.34.1691183236984; Fri, 04 Aug 2023 14:07:16 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:e186:e5d2:e60:bad3]) by smtp.gmail.com with ESMTPSA id n22-20020aa78a56000000b0068664ace38asm2037584pfa.19.2023.08.04.14.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 14:07:15 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Douglas Anderson , Daniel Vetter , David Airlie , Neil Armstrong , Sam Ravnborg , linux-kernel@vger.kernel.org Subject: [RFC PATCH 02/10] drm/panel: s6e63m0: Don't store+check prepared/enabled Date: Fri, 4 Aug 2023 14:06:05 -0700 Message-ID: <20230804140605.RFC.2.Iabafd062e70f6b6b554cf23eeb75f57a80f7e985@changeid> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230804210644.1862287-1-dianders@chromium.org> References: <20230804210644.1862287-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. For the s6e63m0 panel driver, this actually fixes a subtle/minor error handling bug in s6e63m0_prepare(). In one error case s6e63m0_prepare() called s6e63m0_unprepare() directly if there was an error. This call to s6e63m0_unprepare() would have been a no-op since ctx->prepared wasn't set yet. Signed-off-by: Douglas Anderson --- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c index b34fa4d5de07..a0e5698275a5 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -270,9 +270,6 @@ struct s6e63m0 { struct regulator_bulk_data supplies[2]; struct gpio_desc *reset_gpio; - bool prepared; - bool enabled; - /* * This field is tested by functions directly accessing bus before * transfer, transfer is skipped if it is set. In case of transfer @@ -502,9 +499,6 @@ static int s6e63m0_disable(struct drm_panel *panel) { struct s6e63m0 *ctx = panel_to_s6e63m0(panel); - if (!ctx->enabled) - return 0; - backlight_disable(ctx->bl_dev); s6e63m0_dcs_write_seq_static(ctx, MIPI_DCS_SET_DISPLAY_OFF); @@ -512,8 +506,6 @@ static int s6e63m0_disable(struct drm_panel *panel) s6e63m0_dcs_write_seq_static(ctx, MIPI_DCS_ENTER_SLEEP_MODE); msleep(120); - ctx->enabled = false; - return 0; } @@ -522,17 +514,12 @@ static int s6e63m0_unprepare(struct drm_panel *panel) struct s6e63m0 *ctx = panel_to_s6e63m0(panel); int ret; - if (!ctx->prepared) - return 0; - s6e63m0_clear_error(ctx); ret = s6e63m0_power_off(ctx); if (ret < 0) return ret; - ctx->prepared = false; - return 0; } @@ -541,9 +528,6 @@ static int s6e63m0_prepare(struct drm_panel *panel) struct s6e63m0 *ctx = panel_to_s6e63m0(panel); int ret; - if (ctx->prepared) - return 0; - ret = s6e63m0_power_on(ctx); if (ret < 0) return ret; @@ -564,8 +548,6 @@ static int s6e63m0_prepare(struct drm_panel *panel) if (ret < 0) s6e63m0_unprepare(panel); - ctx->prepared = true; - return ret; } @@ -573,9 +555,6 @@ static int s6e63m0_enable(struct drm_panel *panel) { struct s6e63m0 *ctx = panel_to_s6e63m0(panel); - if (ctx->enabled) - return 0; - s6e63m0_dcs_write_seq_static(ctx, MIPI_DCS_EXIT_SLEEP_MODE); msleep(120); s6e63m0_dcs_write_seq_static(ctx, MIPI_DCS_SET_DISPLAY_ON); @@ -588,8 +567,6 @@ static int s6e63m0_enable(struct drm_panel *panel) backlight_enable(ctx->bl_dev); - ctx->enabled = true; - return 0; } @@ -709,8 +686,6 @@ int s6e63m0_probe(struct device *dev, void *trsp, dev_set_drvdata(dev, ctx); ctx->dev = dev; - ctx->enabled = false; - ctx->prepared = false; ret = device_property_read_u32(dev, "max-brightness", &max_brightness); if (ret) -- 2.41.0.585.gd2178a4bd4-goog