Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2341393pxb; Fri, 17 Sep 2021 07:43:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIV1mePS8YU9bTKDmBPNyASd8MVJw5EIXx/tJ5t4Veb6i54o44lA83tth7SAvuYkx2Bpc7 X-Received: by 2002:a17:906:dbd8:: with SMTP id yc24mr12446921ejb.221.1631889834423; Fri, 17 Sep 2021 07:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631889834; cv=none; d=google.com; s=arc-20160816; b=UxbvGFn19R8OOmqcv945gOfyqMpzPaIKbctGT13ZSKCpTeoF0wJAHQOLqJjBsh7mty fp1z8GWeodnlZ21vbEPb2pRaJ4N6xyS4Z6H85hG1cw3FapCpcpKybok/ufSTkToChrWg ScSIJ1g1fCpbqIznoSeNnLunoPv7nyWTZ59h4m0piP4XvWf1absAlliU4+VHmnPet7FY 7q1J787H4xJgQCC0lxpkqKkLwBWB6EBRW9lfdoFBpOsVMK5TLbgap7IgBzAMLE1eqDIq Kos6pfyE+wyl7B5oVpv+HbF1HZdWzcGMMTZnMt5AqeYWs72bbeUxGbFyJyPxLQQTuzm9 9k8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fXWGJEAQybr4pDDlLtgHrDW/3jidDvhIRctY0I2WY0M=; b=Np7JuveIX9L77+ahxI6DAWGYKOysYiuh2yV31mYyNBySdCh8Kky6cVkpDiniByFAGm 2Vt89Z/nKNFtFtcqTV9adLM5RcAXcvrGEpCe/rXbW4pNofA9ZcRG04MUazneuCrL0GQq MpeQRt/aqRNgbIt+Ga+SBJBOUFCqYzwa1K1XxCOhHsC/rR2Xwm00RgwJVVR0KdFK21yb nBp9z7YyCazWwAaV8JuLHY9EjDkvPM0jPkOo/Wyl+L3YEoVvZEKZX/fQkzB+2n0nALmU fVK56FSHKPYHWumfZ7kgjFic8ImZLSFPdJ5AVedsclKqYMGqAEsqVUCdsgouozCpXGvh lSyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qPgJLXy+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz19si8082806ejb.632.2021.09.17.07.43.28; Fri, 17 Sep 2021 07:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qPgJLXy+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244105AbhIQMce (ORCPT + 99 others); Fri, 17 Sep 2021 08:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244128AbhIQMca (ORCPT ); Fri, 17 Sep 2021 08:32:30 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3287C0613C1 for ; Fri, 17 Sep 2021 05:31:08 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id x6so14862110wrv.13 for ; Fri, 17 Sep 2021 05:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=fXWGJEAQybr4pDDlLtgHrDW/3jidDvhIRctY0I2WY0M=; b=qPgJLXy+HvWqdCsqUso4O/PwcACuu8RYEdyfOsmYHTWf5gT6XiAU0uzqalmKErux4/ hUNQJMMAHx7W66PiCWmOEMtjfRWWsTWJw22JcaIlH5WwShoxgztXd5ROnhYpxcIL8pwF +fv2/LiW8OY8pA63ER2Rl74dkVVD6x6wIbcv2lQaxQ9m1J2u5+TCNwTSpT+DbIVKJQED 47m+1Gi2tUy4iW6w6huQte7RrfeRdCg5qNZUZ+juh66T9lmleEDBxKPHI6I+H7YztyXy lCdfPW/FkEVzRhI3bTqn/vgFKom5himskuUEJ1g8LqgLoL7BlQRs1iTdkEoBUF7+JACZ qhEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=fXWGJEAQybr4pDDlLtgHrDW/3jidDvhIRctY0I2WY0M=; b=71haUNj0fvyQqQUur3aXqPS2Kdre6y1NCJnHZ02UkoRIBgfVF/bBxTbn8Wmbr5hK4j wMmMGeoNPji+1Df0FFRYT/O3drsDb8qrWbO+PDYz2auiHZ0mseEpjf9ULaIllPtVeNH3 rMeSc5Rn2Orajc7jbxWX7fLzWOoZWLvYpGRcVSy63xM2BsCAuSevqMzb1wlTH+sEqcJ+ ZICZCTRYPa7tzkzz5p6Tpoy9Aq3LWMYTygSzswzDrILcHnWz5igG7xhozGIIOSoGB4pl zqfxG33nJyluvblUYZvlnhXXiG2mItr9OJbCk3UjerZylbwVCVhSQn/VZ+N4puVOs1kM S5nQ== X-Gm-Message-State: AOAM533wXkwnD82OcSBVb7jlTZyJtNj4WbMoTizMWiH0iKIJS5VanS12 Zlfx2I0touqqLvkcqvDO1Rflxy6Lx4kl67eL X-Received: by 2002:a5d:448d:: with SMTP id j13mr11597328wrq.212.1631881867207; Fri, 17 Sep 2021 05:31:07 -0700 (PDT) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id q11sm10709020wmc.41.2021.09.17.05.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Sep 2021 05:31:05 -0700 (PDT) Date: Fri, 17 Sep 2021 13:31:03 +0100 From: Daniel Thompson To: Cai Huoqing Cc: Lee Jones , Jingoo Han , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] backlight: bd6107: Make use of the helper function dev_err_probe() Message-ID: <20210917123103.33oytfwhpcakdi2w@maple.lan> References: <20210917031308.17623-1-caihuoqing@baidu.com> <20210917091729.elpngrzpvmp43wns@maple.lan> <20210917110528.GA17963@LAPTOP-UKSR4ENP.internal.baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210917110528.GA17963@LAPTOP-UKSR4ENP.internal.baidu.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 17, 2021 at 07:05:28PM +0800, Cai Huoqing wrote: > Hi > Thanks for your feedback. > On 17 9月 21 10:17:29, Daniel Thompson wrote: > > On Fri, Sep 17, 2021 at 11:13:06AM +0800, Cai Huoqing wrote: > > > When possible use dev_err_probe help to properly deal with the > > > PROBE_DEFER error, the benefit is that DEFER issue will be logged > > > in the devices_deferred debugfs file. > > > Using dev_err_probe() can reduce code size, and the error value > > > gets printed. > > > > > > Signed-off-by: Cai Huoqing > > > > Change seems OK but does this really need to be done one file at a time? > > I'd prefer to see all of backlight handled in one go (given the scope of > > this change if applied across the kernel it needs automatic tooling > > anyway). > Only two related patches for backlight. Can you explain how you reach this conclusion? I only checked two drivers (the first two when you list the drivers an alphabetic order) but both contain code that appears to match the pattern you are targeting. > I try to keep one patch for a subdriver, sometimes different > subdriver owner need to mark reviwed independently. For mechanical patches of this nature I don't think there is any need for acks from individual backlight driver authors. Reviews are 100% welcome but we would not hold a single patch back until all authors have reviewed it. Daniel. > > > --- > > > drivers/video/backlight/bd6107.c | 16 ++++++---------- > > > 1 file changed, 6 insertions(+), 10 deletions(-) > > > > > > diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c > > > index 515184fbe33a..e21b793302a2 100644 > > > --- a/drivers/video/backlight/bd6107.c > > > +++ b/drivers/video/backlight/bd6107.c > > > @@ -120,7 +120,6 @@ static int bd6107_probe(struct i2c_client *client, > > > struct backlight_device *backlight; > > > struct backlight_properties props; > > > struct bd6107 *bd; > > > - int ret; > > > > > > if (pdata == NULL) { > > > dev_err(&client->dev, "No platform data\n"); > > > @@ -148,11 +147,9 @@ static int bd6107_probe(struct i2c_client *client, > > > * the reset. > > > */ > > > bd->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH); > > > - if (IS_ERR(bd->reset)) { > > > - dev_err(&client->dev, "unable to request reset GPIO\n"); > > > - ret = PTR_ERR(bd->reset); > > > - return ret; > > > - } > > > + if (IS_ERR(bd->reset)) > > > + return dev_err_probe(&client->dev, PTR_ERR(bd->reset), > > > + "unable to request reset GPIO\n"); > > > > > > memset(&props, 0, sizeof(props)); > > > props.type = BACKLIGHT_RAW; > > > @@ -164,10 +161,9 @@ static int bd6107_probe(struct i2c_client *client, > > > dev_name(&client->dev), > > > &bd->client->dev, bd, > > > &bd6107_backlight_ops, &props); > > > - if (IS_ERR(backlight)) { > > > - dev_err(&client->dev, "failed to register backlight\n"); > > > - return PTR_ERR(backlight); > > > - } > > > + if (IS_ERR(backlight)) > > > + return dev_err_probe(&client->dev, PTR_ERR(backlight), > > > + "failed to register backlight\n"); > > > > > > backlight_update_status(backlight); > > > i2c_set_clientdata(client, backlight); > > > -- > > > 2.25.1 > > >