Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp247032lqs; Tue, 5 Mar 2024 00:09:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUxVICa5pg9xXQH4cVi+tjy/lYVuauZ/ZKU2XHCxAJSTO5YC5fn+hvnZS2RJpP6EGzr0KJnwVG6vZnGdZUyOI9VuyBWzTQT+IhTXVWs7Q== X-Google-Smtp-Source: AGHT+IHHTxAYyUvUbdtCxmE4oum1eN5iuZ/ZNx2elkOb35lOp/0yfCYx7rGx+Qfu8asOAKX7XkmC X-Received: by 2002:aa7:d44b:0:b0:567:4694:159 with SMTP id q11-20020aa7d44b000000b0056746940159mr3417269edr.26.1709626169342; Tue, 05 Mar 2024 00:09:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709626169; cv=pass; d=google.com; s=arc-20160816; b=QndwTTvbb+mcSP4kzoqOgigDXFCLwA6lYBICHYqmojr/8JJP2kyiGuVzMPOZCkvb9F 8IWjkln0nC2NZzcH0LT3ckCwzFvCPL8HZBQvjQ7xsUwyPMWjQIKOKE0OvHQv1+QA00ki 916hEdBf5+RZMGH87lg6VeteNmv1xAKHjS4+DBuPjk9n3KkEQXPBYESSlfP29uK7wpKF tPOPNb216rb6VzARw3T6wqLMEcalco2OsHB3svzDRBrsivUDjqIW20BK5L1R1pLL+YeG 2Dzb6Yla95Fc4HAEOYs//u7UPhv8rXOjuwcahPNLD0pUPxHHp8Il8BO741fvZ0OVyffG 0c1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=nGlX+l5FrCtoGILdkXog1qk1JDD1pTX7Iy+8O9A+Pew=; fh=NkErwmaqGVjllTkhhOikTfe1exW4tNDwL8eUEh1yn3Q=; b=yGJzXs9e/U8o8ra+p8jM8KuzEbxoSrcJMJ0XaGi2qbtcfZDDGn7s3u4EKd9yCU9pe1 fxXdq6w64zObwWkSYEjpITlsHpSd697ufSjjjEJ3x+MU3N3J+ceiXXXYqzIDl5zNVWLm fn2UCE6NSp6QEaz9+pqRQUlulCP6srj49OUeFdJLvG+qw/jZCXbTXGTD3h4sWzUzS3Co /inXHfNYvq9jwoipc2qbYWO3o2xU/YFrH+wePbR+TqjgyMlI+zz9YmH/Vt4sIsUI0ihb EnFOEQ7pfzTPzni4WVnoPcL4DqAiNZkUgfckfHIqD4NOlT/1z64hAqkFBRbuX+ovcNA8 C5uw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MLPYemVb; 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-91865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y37-20020a50bb28000000b005662a20fc96si4941619ede.190.2024.03.05.00.09.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 00:09:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91865-linux.lists.archive=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; dkim=pass header.i=@linaro.org header.s=google header.b=MLPYemVb; 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-91865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91865-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E5ACD1F21E19 for ; Tue, 5 Mar 2024 08:09:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13BFF7F46C; Tue, 5 Mar 2024 08:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MLPYemVb" Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (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 3EA317EF0D for ; Tue, 5 Mar 2024 08:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709626160; cv=none; b=R8LwR02rg2eMwE8bYQSpJTiKDTjwsUAb04WhB4uScubJmVVQW4zxfIqN/OkYVkrQ9evTaQixkr4g23JM46JVFMwrHpvhZSKI0fkLAbippdtVa0EHsozsBsIDqWEoqm5z4hDyjbdTRQ2YW+pHTBAsuzOttmkd11X3KauqtpWVsmI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709626160; c=relaxed/simple; bh=gxghkhfCwCcy3FiXcI5OlAqUdRUVdOy92wS9GSHk/80=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rRPHg/pLGMgjBMJYtIJA9gSIEQKsjC8J0t256yGMkhrZTTHXuuKId2Qo8aJOMvStzf7NeCvs0UPznOFjO2dGY2mrvGYw23Mfoq7AbU5rdk4Ye1z5JFgM6mXE8mgfJyurksoJULMmcQW/Zx8qxzrUkSgSJxv7yYXsrGKmfkxaKL0= 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=MLPYemVb; arc=none smtp.client-ip=209.85.208.176 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-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d275e63590so77184931fa.2 for ; Tue, 05 Mar 2024 00:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709626156; x=1710230956; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nGlX+l5FrCtoGILdkXog1qk1JDD1pTX7Iy+8O9A+Pew=; b=MLPYemVbAxSGxdpcow3wgkCzpuQYh11DZABqXRaT3uqrerSYx/th2ZnpY7CBv6jd9m n6wep15P8HCiFToIXRnEtGKGshzl6XJdiwDeME3Bfx7XDmn+Jdo1n4hH0oo5+bd83gas m+OHsCPqgcMX02dFRuaF8e/T92b1ewHzleugQrFJ3D5jwg2Xls5FO3P6ymg7DFZxd/7N 4zcd1yYXatHRXZ8i0LMuYmPPWltjanrDJxP8KRJKQTkmAHEIgIuw3nlbXm+HKLm/986U 4SEUwClW2ZneIM3FpEh7x9Gv2utfdHn8GtuziB0Cus7JKrhcCoIkd9fO3wkzUQHRllTU DKsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709626156; x=1710230956; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nGlX+l5FrCtoGILdkXog1qk1JDD1pTX7Iy+8O9A+Pew=; b=tLpbzTm80s0hUS8Hp3aTzHD8geXz8LBqi4UmbM6nfCURvEbjgH/zaaf/qLn1c7wwAN LmOZ58B32AKXYB5nksUVlO8ymeOElsk0L4VW9TwicCJbfK510tpiBQYXr5vzBCh81nYi qNwVaVPh9QjMuxcWWC8XLpFu0sYFg/lXhrHx3e1UbdXhadfg9jsk+FFxSYV/rPI0bS/u +MOJrw6houaevMLbIF7cllhDyUVVZ3hFDHBh+eiBCAcU40T3ePW6EE2KxPwWa+4wqcjB F83ARtO2HMKjJm8eYMYEKDPSWIdKYWXrPRsrLIK1cknracr0XQO6O9No+w1M/UQTZjf1 jYbQ== X-Forwarded-Encrypted: i=1; AJvYcCW+m7z+6/O+M9Gu2BVcDfK1XcxR3wG1oK/hl+gi7zioGqyPkqnC5Bc6/NiXAVpnBZPwqM3HnR4H4puGMjiJpjSPOC6ElbmOi6fK5zuj X-Gm-Message-State: AOJu0YxXsq1kK3rDmQhpnqwiTEWYckwfepmNytxHARTphezwQuqQ2QCn 852rqGpfniSpp3Mem6veKx3v9iI6Y2ZjuN3BcgUI9y1Fkr6CTrFaizUXTctlSzs= X-Received: by 2002:a2e:a7cc:0:b0:2d3:ada:29e9 with SMTP id x12-20020a2ea7cc000000b002d30ada29e9mr856360ljp.12.1709626156438; Tue, 05 Mar 2024 00:09:16 -0800 (PST) Received: from [192.168.1.20] ([178.197.222.97]) by smtp.gmail.com with ESMTPSA id m18-20020aa7c492000000b005662d3418dfsm5497551edq.74.2024.03.05.00.09.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Mar 2024 00:09:15 -0800 (PST) Message-ID: <1e7e0404-ccb4-4994-abc3-12c3f53c2603@linaro.org> Date: Tue, 5 Mar 2024 09:09:14 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/7] backlight: gpio: Simplify with dev_err_probe() Content-Language: en-US To: Daniel Thompson Cc: Lee Jones , Jingoo Han , Helge Deller , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240304-backlight-probe-v1-0-e5f57d0df6e6@linaro.org> <20240304-backlight-probe-v1-1-e5f57d0df6e6@linaro.org> <20240304104000.GA102563@aspen.lan> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4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ftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240304104000.GA102563@aspen.lan> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/03/2024 11:40, Daniel Thompson wrote: > On Mon, Mar 04, 2024 at 11:11:38AM +0100, Krzysztof Kozlowski wrote: >> 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"); > > The "Error: " should be removed from the string. dev_err_probe() already prints > that. Sure. Best regards, Krzysztof