From patchwork Thu Jan 4 12:41:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 184985 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5588703dyb; Thu, 4 Jan 2024 04:52:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmxM4gxMqflGxEbpTz0Ssx8uBwdCkz97pV89JE0p4tnR0N4P0HheO7OpRRdLsy5KeivTPT X-Received: by 2002:a05:6214:2b0f:b0:680:ce74:9515 with SMTP id jx15-20020a0562142b0f00b00680ce749515mr561015qvb.93.1704372740198; Thu, 04 Jan 2024 04:52:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704372740; cv=none; d=google.com; s=arc-20160816; b=xJtyX0L1vgGHNIY4Sm3fEwoJW8ANeUX3beJ6UyEQFcvB7b4hVXY9m9sQe0GIFM1APj 7Pw+RbeCmCsGjyaM8hFOSKFFcRnZsNXtiM3HIIEUGHKlV44MnbgAGsZzJAp30d2mlKSM QMta7eZfwy2rL9FhbljhupgVKEAVMdawqIAM1vodLX0q+bLyPz5oBJexjr/3r6Ytol1e m9oe86MXKvSvUk9dL8BZG7L6WXh7yWlER09diRao4rS/9LW9oLALj4nggx0ws1syhej5 cVTpzTSDg6EZMlHYF39odWfiTq3tH4XESSpNCXwdBzFyzNEwt+lJEwOQyJNQ596bD82E FblA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=eXjcQzobubevG4rm1AbTK70bglA3mlT9ec6Qzkk+Q1k=; fh=zL5V5Qa/Cm+cYsSx/i/aRqSBIZSDNxCrc/UdPyDFK4Y=; b=vdwvmTo2h1eV/G1Srz3y9FR+ToOn+Ye7tenbMBkkmY4I/fLwb9RBiVlaNSJDNz1ZUG gcS2EUK/cZxf4JSlU7gK1mtIcpQhRYZQGZ5GnYPyTpbH6YYivWhcF6UL4G7/NC7NhwrQ t09jcUE+xc3AMsLSvIVIIw1fo/v/5PP+K2+YeD6gECK7XbNIaYT/xXrPMFV4t6EvmWk2 di28nOwMS4vQUXSUQ0HkAab2yoRyFAfpzu9SqsKq6v6TYFKYlpHipzvN0vPQS1x2J0u9 ujhFVM3rtkXY2Qz0anoslqS4eKro71RYcIdZxEQHr1QAPlcndxkLPif/lDxtQ6tNRNHR EZ6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16661-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16661-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w14-20020a0ce10e000000b0067f32e92d37si32611118qvk.31.2024.01.04.04.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 04:52:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16661-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16661-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16661-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 03D821C21609 for ; Thu, 4 Jan 2024 12:52:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E26C622324; Thu, 4 Jan 2024 12:52:01 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-190b.mail.infomaniak.ch (smtp-190b.mail.infomaniak.ch [185.125.25.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FE262137F for ; Thu, 4 Jan 2024 12:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=0leil.net Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4T5R7G64hBzMpnWg; Thu, 4 Jan 2024 12:42:18 +0000 (UTC) Received: from unknown by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4T5R7F6yDnzMpnPs; Thu, 4 Jan 2024 13:42:17 +0100 (CET) From: Quentin Schulz To: Neil Armstrong , Jessica Zhang , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Quentin Schulz , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Quentin Schulz Subject: [PATCH 1/2] drm/panel: ltk050h3146w: only print message when GPIO getting is not EPROBE_DEFER Date: Thu, 4 Jan 2024 13:41:57 +0100 Message-ID: <20240104-ltk-dev_err_probe-v1-1-8ef3c0b585d8@theobroma-systems.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240104-ltk-dev_err_probe-v1-0-8ef3c0b585d8@theobroma-systems.com> References: <20240104-ltk-dev_err_probe-v1-0-8ef3c0b585d8@theobroma-systems.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.12.4 X-Infomaniak-Routing: alpha X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787164350545117100 X-GMAIL-MSGID: 1787164350545117100 From: Quentin Schulz devm_gpiod_get_optional may return EPROBE_DEFER in case the GPIO controller isn't yet probed when the panel driver is being probed. In that case, a spurious and confusing error message about not being able to get the reset GPIO is printed even though later on the device actually manages to get probed. Use dev_err_probe instead so that the message is only printed when it truly matters. Cc: Quentin Schulz Signed-off-by: Quentin Schulz Reviewed-by: Christophe JAILLET --- drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c index 30919c872ac8d..ecfa4181c4fd9 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c @@ -646,10 +646,8 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi) return -EINVAL; ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(ctx->reset_gpio)) { - dev_err(dev, "cannot get reset gpio\n"); - return PTR_ERR(ctx->reset_gpio); - } + if (IS_ERR(ctx->reset_gpio)) + return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "cannot get reset gpio\n"); ctx->vci = devm_regulator_get(dev, "vci"); if (IS_ERR(ctx->vci)) {