Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp80360pxb; Fri, 17 Sep 2021 19:29:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwao7izrzqgUKVRxjBVP0Y4E9qEZFy5ogoV6rRt+Et/9FZrg74vhEnYbkNW3Y/4pAEVw91g X-Received: by 2002:a17:906:3fd7:: with SMTP id k23mr15467356ejj.176.1631932188743; Fri, 17 Sep 2021 19:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631932188; cv=none; d=google.com; s=arc-20160816; b=q/M4JcoW21DjrRPUgLD/Z4eD6sjR6IGAuFfBz6C9Ds02uh/IVGw1+bTrTFMBDk/h/0 8+WVMW2S5l3/gZHXYpoeZWcDt4GxvePdxs56YyIBmLRTpjQHSxHImTKY4DS5UIw531HV rZcTdmpxfCeEIO+DadrneTMWp9R3kPUO+d0hJ9ZMpcJM+rQa4o8xcrTq92N82g7iZnqQ MPrcvar4RXnmZT3ELmu1iZgQGQtLEEgYzimanJBy3qvyN3Gx0kUqgR5uCSYlFjJI2R+I 129r1dxPl6Seh3j5/RXeWqE9spRmBugA+fwJczwVFZnK/YAjk4Cti/O33AqADReg9Sbw FaKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2uGSUJ4OwEDinUYdbE9Xm9EZmCzZGXaFlbE5avYj6BU=; b=dSPa51+uP2Xb+grf5YhFTEzAiwT5dyAkuXj4KpgvF3bLZzlKnrfAgdT47SjBpfrK4H vc4mlGL9F3vMsD1esrx4/z27mANcyETPa4Ykng3hamFCagMmgJQCRpErvGH3BMylQ63i p7rVlm9iydERCHUI7C9GHm4YdBFqWO+D7Fvux07/JwclSWgOLhdEn9MCjPO3disJFOsU rFm5e4jQCQZheF2lPZ5MgHxG+u7NmVt0qUVNdzbpe3C7E29TlpWsnrF7DCy+jABVslZD SI3QtcW6ov/T9tGmVy5kkLzj4tipG5JuCM/YHALL4D6V57ffBifn1i13bCtV1cW+uWTA c32A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HAXr+ree; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si12538323edb.418.2021.09.17.19.29.25; Fri, 17 Sep 2021 19:29:48 -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=@redhat.com header.s=mimecast20190719 header.b=HAXr+ree; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231364AbhIQSjE (ORCPT + 99 others); Fri, 17 Sep 2021 14:39:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44316 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234566AbhIQSjA (ORCPT ); Fri, 17 Sep 2021 14:39:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631903856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2uGSUJ4OwEDinUYdbE9Xm9EZmCzZGXaFlbE5avYj6BU=; b=HAXr+reeIrWgIG2HORKAqF7eUQS9F9b1bB0EnPhQbL4uWhTptIE3EGWdgdfTKsMG+oae10 esIooirIeNfSbQs5WZuBESY18vqhSGvRDCcwLeM0mPnvpMPpoBqInLipsZQBqit6mMBpio o8M+Mg8qRonjKNIWSV7+eoRMJuiYo58= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-559-eCKz45_GOUqPFbhUxldQQg-1; Fri, 17 Sep 2021 14:37:35 -0400 X-MC-Unique: eCKz45_GOUqPFbhUxldQQg-1 Received: by mail-ed1-f71.google.com with SMTP id x14-20020a50ba8e000000b003d5a565de3aso8969147ede.18 for ; Fri, 17 Sep 2021 11:37:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2uGSUJ4OwEDinUYdbE9Xm9EZmCzZGXaFlbE5avYj6BU=; b=TZT7EpjfXBEP3JFgUNw+igW95FOQBcGs8N9l2wMLBFcQE7JJhzlkYgDPX+9h+YGPe/ bDmSDORqbjmTICEV/YvdMoCjCYC5CsklD+ELDm+QUTW4UDQSQs273KhGLF11aoPJbbUs BWxj3HpQ1t0mlGeENyNf3kMtCBHr3/Q1Dm5r7ps05QzvI+uOrXmOGEWB1nnTW8nBG5Iq mLL0wt2CWhqsgwx10SUoXyuu1jxjPsL0WYXONV0yxvQoH1SN65kOhet2LESadt8NCXRs C8aZkkMiEZnLRZQpxTFctgNUOYwX4UEl2MnEP/ZNRln2OvyLf5Sn+SFwonl/B2TtCW8X R90w== X-Gm-Message-State: AOAM531l7LKdL3iN6wGw9Reeoor316UJWB5xdxPMaBbgovLreyjIohwi hBxOPDTeMQR5XoZgZimtLhsoS35g///HmtoGimctlqbgcmPtjmuvIltDOEOTy8fjS57DBer9otq Bkgh+m75oyzQRt7Y76bIkaCiCzOxh+zCrvKfr2pzpZ5i5XOp4UuB8Zm410ojtcFH+bdBSH3vRSr X+ X-Received: by 2002:a50:e1c4:: with SMTP id m4mr6128306edl.307.1631903853557; Fri, 17 Sep 2021 11:37:33 -0700 (PDT) X-Received: by 2002:a50:e1c4:: with SMTP id m4mr6128287edl.307.1631903853384; Fri, 17 Sep 2021 11:37:33 -0700 (PDT) Received: from x1.localdomain ([2a0e:5700:4:11:334c:7e36:8d57:40cb]) by smtp.gmail.com with ESMTPSA id e22sm3175909edu.35.2021.09.17.11.37.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Sep 2021 11:37:33 -0700 (PDT) Subject: Re: [PATCH] Input: silead - Make use of the helper function dev_err_probe() To: Cai Huoqing Cc: Dmitry Torokhov , linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210916153426.15158-1-caihuoqing@baidu.com> From: Hans de Goede Message-ID: <83e5b7db-4707-0ab3-c02e-e467c3190358@redhat.com> Date: Fri, 17 Sep 2021 20:37:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210916153426.15158-1-caihuoqing@baidu.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 9/16/21 5:34 PM, 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 Thanks, patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > drivers/input/touchscreen/silead.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c > index 1ee760bac0cf..adfac271f0b5 100644 > --- a/drivers/input/touchscreen/silead.c > +++ b/drivers/input/touchscreen/silead.c > @@ -548,11 +548,9 @@ static int silead_ts_probe(struct i2c_client *client, > > /* Power GPIO pin */ > data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW); > - if (IS_ERR(data->gpio_power)) { > - if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER) > - dev_err(dev, "Shutdown GPIO request failed\n"); > - return PTR_ERR(data->gpio_power); > - } > + if (IS_ERR(data->gpio_power)) > + return dev_err_probe(dev, PTR_ERR(data->gpio_power), > + "Shutdown GPIO request failed\n"); > > error = silead_ts_setup(client); > if (error) >