Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1751734lqg; Mon, 4 Mar 2024 02:40:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXIteKjYFH61Cwn7rmv+HQOdLkQ14sMkASEN1XepK6gr+s+2RczzBXnbH9OWtleFrS8M7mjN/pgtB2Udqs2eHe+oiJL1WxCcEBoGoyAaw== X-Google-Smtp-Source: AGHT+IG5IWdeM/Gd7VlYdxiIa9xGAaZav7stY9qXidgT9RFv/rm6rQg12kjPUWYAfjy0EiaLX87s X-Received: by 2002:a05:6402:323:b0:566:a822:990e with SMTP id q3-20020a056402032300b00566a822990emr5740416edw.38.1709548813187; Mon, 04 Mar 2024 02:40:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709548813; cv=pass; d=google.com; s=arc-20160816; b=hfb7trBWw16+JqRZPjGVGZpLunmyX6Q/v0Ui8izwQC1hmvIPaGHNAi3a+yCUN3W5Sa 1NjjJVzBM6veYJFbJ64eIu0WvHgxQKE4IqI8JdiyQO1nXN7qwXZ/QGzsPooyihECxOLB JbWiw9EBvc2Wr/JJx/H3CXYm05Ktd6TRxMO1XGWGeyMuJooKfgpshJBhgIwPIqoQXGn/ u2i/FjOf5vyRKrukp1/NttYogtYxHcaV7qDYB3+y9uqtr7yLhH2uMPhpKqAsv7xWni8C DpQEk3yE3XPQSUpa0Zw4Nj8bgxkM7UVVW/HV7ISeBJBdHSzHPi6aB9AlDsyk+bQdh58a 5TSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W9/tP/ZbC0JsITFItqvv/KxYTeSI+hdxPkuzSwYAtNM=; fh=aVNvXGIuXmkWu9zKAAkfiB0p++JTtzu8cSjr2Hb4bmg=; b=l2isVNdBnfbu10yNyvyV2TdwK07RIMaUBrXBFTXmr9Sy34eaniTvjStwvlTjddCADq n7uPZWGr6y3K9+lY5jCMe9NSGBnioLjgOc4f5peglBPm3FUmhpey+56qW27ZdmaZJXU0 F62yaXdwSH2HXUqrQ2Ign8+hl8jiOdX9geSx6XK/+muqScIE/dlJalZEeIlS+v0BOOKl 742kKhPnxqFyZiW72NZ3Xblx+kMewoisAigJJ88fXCRjBBdIjH0wcHrIk+C7vRaD+e4J XInLOIUxw1XsHOO891Fhx7P35QYUb3xV3f0p46RG6PRWI4FhGAUK1MpIUCvAWlf9XoJL 4cXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CrAEHXon; 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-90442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90442-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. [147.75.80.249]) by mx.google.com with ESMTPS id z99-20020a509e6c000000b0055eba1df579si3795333ede.571.2024.03.04.02.40.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:40:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CrAEHXon; 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-90442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90442-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 E63001F22A69 for ; Mon, 4 Mar 2024 10:40:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12DCA37166; Mon, 4 Mar 2024 10:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CrAEHXon" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 8144E36B04 for ; Mon, 4 Mar 2024 10:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709548806; cv=none; b=sDnHWvVw5WtD0KMBZcovBeejBz7Ayr+X+uPdgBczBBakv/Kg9H2uqpUFbVtNgaKwBx/41tJW75RuzI06HC9o5l8mW9BMRw9KHiqVjKRCDY4LrD4iy6vJ/5F4IOMTZQN+RC5aobA+zIX+/UzyUlV25/X3hh+n3qpSGwSFD0s0X4k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709548806; c=relaxed/simple; bh=1QpDL7otKaLVRfvpxBnWM75rS6/RsB/zuNBPtPTxMoY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AcqEgf/Z5jsJodfVhiJtWLxPyre2mkKUFq1j9uAlm0GnVoD+NPFx9j2MKuw/TSYJOsscHI+cKGo0eSBh6tKPzmDfWD/ypcyDIMmkWiPAYDdEsXZ0y/FYhtPgAe1uyLetFBDGrJGKlv8cx4R3qPogi4zwJFazJxsqDigYxuCjEKI= 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=CrAEHXon; arc=none smtp.client-ip=209.85.208.178 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-f178.google.com with SMTP id 38308e7fff4ca-2d27184197cso58794901fa.1 for ; Mon, 04 Mar 2024 02:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709548803; x=1710153603; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=W9/tP/ZbC0JsITFItqvv/KxYTeSI+hdxPkuzSwYAtNM=; b=CrAEHXonv9u/E+bmwuo6b+6G16H7UbnRbH3VPQOm0Yoo5jziLuaPcvADIlkreP59RZ Z/PdWhv4bJAvZ6gQ0N8q+uKk/Nd6acnLc/7gCLHnX7rS2gP5Sm0Ti3OCAu9bJ7JtWnG6 D4E6HNb5PbVOhJ7wqG27heDjr89ec8t4iHe+ZWaqlQ4IEdXTmhsHxR0Y4YqsIda73VI4 YUzqLU0YAaUZlAI5DfSqAW8LpOWuTCHOVp+YNYi3AlvNnSGiE4a4YrZLIGQaRMAKTMyH 6qtqEKNPnqY8RKexSRiUtFw39K99ELr88SBEgm4GaNU9tdIngYpEiPRoJLq2Dk5dmu47 d7+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709548803; x=1710153603; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=W9/tP/ZbC0JsITFItqvv/KxYTeSI+hdxPkuzSwYAtNM=; b=ijnwYKf5mBeC9cTuVzxQvOOe9wXB8fUodY5WD9xew/oN9v8rLHdSCwP0EG9Hxb/0iy jumV2Yd2vtiKe8WzzwkM+ZJQGQXHBK/cdW9Ebs3rF10wqfVewlxuNdG6HvFLnNJeVDyN hxRbJFwb9GuFD7Y0UpiWVlszEn0YgBtJOvBo8QynPPTMH97ltlNP763F2xfHObG2jCcJ bkliimE/X0MN1i7jLZww3ogEbIpzH7K74E/k9Hkb8ukoxziSCFmikz4hni0vaoN0j0tT tnWw38FJaG0izsrgtASmg/je3JbDgLYH5Ga+pNOEP8a1UwcfYn7212y6LJ+Gepa15JzZ ZXbg== X-Forwarded-Encrypted: i=1; AJvYcCUfxwLXb9QqR88v3xsD5f+Cb5MOEPA1ODBZroURZfmMMR5kI4d06fbfavu2uTSjXcXt5oX/XQjpr3L3aIb4QkrTM8RU/mXzDl9TW37I X-Gm-Message-State: AOJu0YxhiDTNFoDCTKaleRHtpsogxWKbbCjO49L/I0ipXiecsJLP+lh2 L80jLpcvBh8xMTYtNFkchdYl3q/CRzNrEOjvHRSfWcGE58jTiK4mPc2VrqItQS4= X-Received: by 2002:a2e:3801:0:b0:2d2:a9f8:c436 with SMTP id f1-20020a2e3801000000b002d2a9f8c436mr4984250lja.53.1709548802698; Mon, 04 Mar 2024 02:40:02 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id hg14-20020a05600c538e00b0041228b2e179sm14216843wmb.39.2024.03.04.02.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:40:02 -0800 (PST) Date: Mon, 4 Mar 2024 10:40:00 +0000 From: Daniel Thompson To: Krzysztof Kozlowski Cc: Lee Jones , Jingoo Han , Helge Deller , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] backlight: gpio: Simplify with dev_err_probe() Message-ID: <20240304104000.GA102563@aspen.lan> References: <20240304-backlight-probe-v1-0-e5f57d0df6e6@linaro.org> <20240304-backlight-probe-v1-1-e5f57d0df6e6@linaro.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240304-backlight-probe-v1-1-e5f57d0df6e6@linaro.org> 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. Daniel.