From patchwork Thu Jan 4 12:41:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 184986 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5588762dyb; Thu, 4 Jan 2024 04:52:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXtpoawwyS40yTrCYCOenL46zTWXsp2kMpjJLWEMEIcgUCvBeg+ZP7o8OyjE4taer1FriX X-Received: by 2002:a05:6512:acb:b0:50e:ab7c:c6a4 with SMTP id n11-20020a0565120acb00b0050eab7cc6a4mr361072lfu.75.1704372750638; Thu, 04 Jan 2024 04:52:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704372750; cv=none; d=google.com; s=arc-20160816; b=ll+iRSUzG0Rryppq5iNPXyr/zeoknaO8m8lnFDqKI1uvVdYYvEVVb1Vbx871YVcHIj h8Q5ImTfLhPERA0ZcDsDkAojYtRMg/J97I2kmcFoxDFE0dcVQFoiz9tQG7W/2RBoF2Og yd4CKI3tFYOd6yqQytGEHcQoEAp3A/RB4skFBX5otuOScpN6bXcn55VqbZx4jROJlWuy efJVjx2BA3aQBiMnEb8zy2/C+snjDbiLw870Bxta2uf6myyz1h4++5OdE8ZM+SYOdXJl rEMrBqcS7yFgP/fF0ZefMFIZreL5EQcmx/3On1gRn/FN4N0wDGMkdPO/mMEGWexM6m2+ tUmw== 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=+zm58viRgXdYzDvE42vAcCH2HVPry4934VeqKly0N/U=; fh=zL5V5Qa/Cm+cYsSx/i/aRqSBIZSDNxCrc/UdPyDFK4Y=; b=p6rRBPBG3PdOq6MuUbd2g+E7uNk45lw/J1UGI+a9jOyGvvYVKPFf+zqCPP95gnp1PR KviLZ8k7MYY3S6VI25LMTn2nz9JO0TlXv0gVLEo/T0zuSuhHT+f8+Mp+E25y6ULoyc9X LXgyhNMJPA0alVjmA+qx3Slg+ApFbDZhxQliVMnqhBjBET2rUEczRB+u4Fs1MgUrSjts Yr0iYfJ1ushcl1CsH7Ki8njHBBHRXy2Rb7fgzWa0fMBmNC8qKZVBHcvqMtvWCOxZwOod M2CK90nd+i8acmE7+L1m1rXZ0IcJvUENhQdo6I/IO938rRUrVOFlKXOlvYXo0ctpSxmk gv0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16662-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16662-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g1-20020a0564021ec100b0055489f6582dsi11239089edg.31.2024.01.04.04.52.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 04:52:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16662-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16662-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16662-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 08C221F2269F for ; Thu, 4 Jan 2024 12:52:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE13922339; Thu, 4 Jan 2024 12:52:02 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-8fab.mail.infomaniak.ch (smtp-8fab.mail.infomaniak.ch [83.166.143.171]) (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 60E482137E for ; Thu, 4 Jan 2024 12:51:58 +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 4T5R7H5ZSHzMpnqr; Thu, 4 Jan 2024 12:42:19 +0000 (UTC) Received: from unknown by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4T5R7G6TLWzMpnPs; Thu, 4 Jan 2024 13:42:18 +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 2/2] drm/panel: ltk050h3146w: use dev_err_probe wherever possible Date: Thu, 4 Jan 2024 13:41:58 +0100 Message-ID: <20240104-ltk-dev_err_probe-v1-2-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: 1787164361077110929 X-GMAIL-MSGID: 1787164361077110929 From: Quentin Schulz This is only a cosmetic change. This replaces a hand-crafted EPROBE_DEFER handling for deciding to print an error message with dev_err_probe. A side-effect is that dev_err_probe also adds a debug message when it's not EPROBE_DEFER, but this is seen as an improvement. Cc: Quentin Schulz Signed-off-by: Quentin Schulz Reviewed-by: Christophe JAILLET --- drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) -- 2.43.0 diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c index ecfa4181c4fd9..9d87cc1a357e3 100644 --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c @@ -650,20 +650,13 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi) 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)) { - ret = PTR_ERR(ctx->vci); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to request vci regulator: %d\n", ret); - return ret; - } + if (IS_ERR(ctx->vci)) + return dev_err_probe(dev, PTR_ERR(ctx->vci), "Failed to request vci regulator\n"); ctx->iovcc = devm_regulator_get(dev, "iovcc"); - if (IS_ERR(ctx->iovcc)) { - ret = PTR_ERR(ctx->iovcc); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); - return ret; - } + if (IS_ERR(ctx->iovcc)) + return dev_err_probe(dev, PTR_ERR(ctx->iovcc), + "Failed to request iovcc regulator\n"); mipi_dsi_set_drvdata(dsi, ctx);