Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1742631lqg; Mon, 4 Mar 2024 02:16:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUb2xdMWi7jYoJWAFJ8ttwT7ESgbkakFs7ODmhR/Ibuund35x06lrMaFQ18x83aXbowI5AYKmmbJusxySOxpY9pAxnQyHhBXDdyFxZ3Mw== X-Google-Smtp-Source: AGHT+IFau/9H2Aq20yWdbXKiQz58mI0hIshXk4XjTwSOJQ34fBSx6PxsgYroepAtWWNsgacLKY7Y X-Received: by 2002:a05:6808:2389:b0:3c1:b8bd:ad61 with SMTP id bp9-20020a056808238900b003c1b8bdad61mr10851984oib.52.1709547390179; Mon, 04 Mar 2024 02:16:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709547390; cv=pass; d=google.com; s=arc-20160816; b=hYRtaQailu5yrCnQFllLB+/KxYmye6TxnQrRboAK0NuBwF/4piXj4WZOqYgD59A33H OgoJbZwpMsklcehQJ6HPGe7Bsxh968bdjGJFLQjReQ2xWfRqGkBUtBApXOYp+LSsp4KB VwXx5NLmy0wSpRAgCdfvqpLHXra7NUffTkdtRDZe2j44I/qdIvoSgkWLlgCHzSD32lXy 9tYTJ5QEJL97SkP/usHVS5z3+yvjC1Q8VFzjRGGp8vY9V1+kmfKGqLPwaw1Q6XENHPgp wtKQTn7iixYa05/D4zZTv5FfLT451ldT8PKO9i98LJ+SGHfuzY4GaWRQ6dEN5gxX79x2 WjYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=2l7UpgtGLmRWEg57s509hO79ijY7GD7vXKq1B5m81jQ=; fh=HTpa6F5InDKG2T/ZZwuEOcEndje5cn7wQFmU8PPtnI0=; b=iGvWfgSfoNBd4vJLNUYcmFXnkltUG4dSRozjhNTCcbm3/YAOJgSEb2SiToozgGvBDR mCDqkqEVFPk2ONTbxgSVKEqhMmhO5jqRECFQaYCc/ZxTkFfhqIR8ytu2iayO/w3YvS+h MMopcz5HRpJNqRKOLIP638xohlA5NixpBIk0jn1VS6GhEj5s5SGkPsZNBQBEa0c9SRek h3cw3KqkBzwLWJRgtqHpj+xwyiqhD5TU1bEPbveSuD+dcPyruTovylY1V9nPkngGHJeT EzDP8GChvmdF3mQ+CBmM8NGVYeJW9zTNDhopYp9v0MTWZCQW7Ts0XLZ28ejhvLifxMG2 miDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaixYMHg; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-90382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id r1-20020a63d901000000b005d553239b15si8132198pgg.493.2024.03.04.02.16.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:16:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaixYMHg; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-90382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0055BB22E6E for ; Mon, 4 Mar 2024 10:12:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65C69241E0; Mon, 4 Mar 2024 10:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FaixYMHg" Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D397C224DE for ; Mon, 4 Mar 2024 10:11:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709547117; cv=none; b=dsh/E/URjOvmACLTOj3gleV9t+A96uUltO0SxErGBpArIDJLsmursqfzvcir9NHU3/5UebhsJZZokGlKD2MtaGlhjzvdEIuofelmhpEI5HghTxETcpLPYngSGDI7hvP4hDtdyk9G2DblP0dmiKoFBm6mibYb8f0dLr+COTk6/TA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709547117; c=relaxed/simple; bh=L1gsWac4GlPBRR3BJYIkKHgN/RCN5L6+vXyGAdt7/+A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OPVyT0ZhYwRXyIJVDBDRqGh6WLDVqJIoxdcn12PZvmctWu73VrhGcoXdlwHPG40uZgb0XpdggP/nhDPE8N60ehqOiONpY8TMXHV1scPUcJSYq7jS3dJHgybz6ct+I/eO7UIwyYTIgoowPaX3jnTlOxlroSTO1OZwJMO8goLo16Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FaixYMHg; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-565ef8af2f5so5532710a12.3 for ; Mon, 04 Mar 2024 02:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709547114; x=1710151914; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2l7UpgtGLmRWEg57s509hO79ijY7GD7vXKq1B5m81jQ=; b=FaixYMHgXS2yUzge5gKjfWneC0/ZlCBYgnmPsea8XRPIMJ5trYiJ/P/tC9hbbFsrxZ OBH2SxhPmDKbmaxy4ZlU30UmuUiMzRFnUtpn3NyOvWQvHzgpFXG3GG6Xr0lHhoovKfU2 Lc2WPeDw1ZHPLlFgWugPHtgZ/jDUMcdEAOPZwzzyRrbi7crrS9iXDYyKjW5ieFlEWfmt HayzcHVnCeCIgrsBfXQN8eE1ZV+qDiPL3JC1c4QKdRxrx0cPQsfUap7ofPIdpvoBd57/ mb038C3mlOG0nNxFVt+lg6jybNzdq+G4qVMwnoUxDebocUGe5+siXDlo+XX1JV0UZ+wj dtdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709547114; x=1710151914; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2l7UpgtGLmRWEg57s509hO79ijY7GD7vXKq1B5m81jQ=; b=g7cB/L72BNMZQqjATm5sMKMU8BIFu9s6U/n3scnTd0+Ma6MvMp1hyF1lE2FbBcZOL0 TXtAWulpyX41IIYtfkd5iqAIiNdvPjzu0KODAUbtNrtKnLXvsmjuTRAac8tc5Fx0Tjbu oofcqSXCTrJGhzm337WmgFk/zmWGcriUl83R3J5bIXKGcIkOSwKFDZL9xETIiwNX2qvY S2X0QtQaaE1IdooHyEfJlW/1nUDorh6p0YvFbFy7bQQxMXljthoWgjjtEHWPJ+cjF4gI IICgKRgCmHfcB0feMdUyGuZWjdRiytBvRvx4TVOYE7m4Lr0imlo3gJ+XhZp4wkm1c0cY DnrA== X-Forwarded-Encrypted: i=1; AJvYcCW4rQOa/8ORAztP0yyilb3ZYKFcFFho3+KfBs0hy9uH4B1jZ+VixErssQfVUm8Iw7AW0uNoXR+kol5zd8F8UzPSFmjcdcPNPE7nuKdf X-Gm-Message-State: AOJu0YzQqAL3jlxz/9YE933BF/jbjDmaCOpU9R8IPbuk2sBLBtA9jKwm 12kX+TeuFtZj0oXbR+cxPeY2ykrkpqLlH1KBLhmyrTMFR1TiRth3dukvx7/m7NM= X-Received: by 2002:a17:906:f8d6:b0:a45:2e21:c78c with SMTP id lh22-20020a170906f8d600b00a452e21c78cmr2053919ejb.13.1709547114198; Mon, 04 Mar 2024 02:11:54 -0800 (PST) Received: from [127.0.1.1] ([178.197.222.97]) by smtp.gmail.com with ESMTPSA id ef11-20020a17090697cb00b00a44bc99cd89sm2938481ejb.42.2024.03.04.02.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:11:53 -0800 (PST) From: Krzysztof Kozlowski Date: Mon, 04 Mar 2024 11:11:38 +0100 Subject: [PATCH 1/7] backlight: gpio: Simplify with dev_err_probe() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240304-backlight-probe-v1-1-e5f57d0df6e6@linaro.org> References: <20240304-backlight-probe-v1-0-e5f57d0df6e6@linaro.org> In-Reply-To: <20240304-backlight-probe-v1-0-e5f57d0df6e6@linaro.org> To: Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1176; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=L1gsWac4GlPBRR3BJYIkKHgN/RCN5L6+vXyGAdt7/+A=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBl5Z5hj0XQi7kaF+7e81MFcwlKfdVr65vaHpPDi MjsbG2Is3OJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZeWeYQAKCRDBN2bmhouD 1ygRD/938KcTcARGYikW/nyTzAfcX6ZC3q6UvmWTsLjqnFXltYckmIM/zt+gzWek4+bhQ9S1KS7 Qmd2iAiCs6EU8ne7ebg+KIqQO44shqs+JFKqcyukBmdZ5f3P9ijrQk45S6KhhX0Z6PPohIoi98W GvTvFNX35xb/bjClwx8vtCuk8hJo6PolwiWsStWd2eenHGpk3qbOIiLVSV/NeF4TOsyVWpkNpET 9BaDnLv0gBXAePVN6cy9mRLzD5JmzucY8gGBktV+zPhsbpNrTBDOJ/TNiydgwTxSVnJ+q24kWkl saS6lwMG7z2+0bfaiYCq/Aw+MicguWKUDtkyBTa2qqvmhYpP1URYMiOmjk2+aq1t/fpHJuvqrP5 BhpZUHSlr+ck2ZbOJ2ckKXJ5SN3E1gVNVBYieebwzJ8G5m3mXZBKqOOvfQNMeSNfclN94ICR2QL nQIXGnO9EV/OwjRtKLapX9M5FYXsGLYvjXSpP+Af3WU6JHlkhnjGTOSnFBEWujD5yINuJJEF5/a qqopAv0qk5pujRsYiT85L6ZtryQOrZjznB6t3TdaO4dWZPnx8TcRSDulZLen4+WD7vcwUlw3yQl L+GrxwPMuZbqP03xEch1aBS3qvs+KFKTbyngpjIdSk7pFs8yUL+CTQ8q4+egzW+n9eEhvoBjZiB UtT5J0qdAwvwdTA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/video/backlight/gpio_backlight.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index d28c30b2a35d..9f960f853b6e 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -64,13 +64,9 @@ static int gpio_backlight_probe(struct platform_device *pdev) def_value = device_property_read_bool(dev, "default-on"); gbl->gpiod = devm_gpiod_get(dev, NULL, GPIOD_ASIS); - if (IS_ERR(gbl->gpiod)) { - ret = PTR_ERR(gbl->gpiod); - if (ret != -EPROBE_DEFER) - dev_err(dev, - "Error: The gpios parameter is missing or invalid.\n"); - return ret; - } + if (IS_ERR(gbl->gpiod)) + return dev_err_probe(dev, PTR_ERR(gbl->gpiod), + "Error: The gpios parameter is missing or invalid.\n"); memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW; -- 2.34.1