From patchwork Sun Jun 25 16:28:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 112643 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6997824vqr; Sun, 25 Jun 2023 09:31:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/stt4RGlbBv0xgShkjzDed/H8CJI1r7WjdvhRUR19azt2P7aDQ+LI7/yH4t86NNcrp9+y X-Received: by 2002:a17:907:75e2:b0:98e:43ce:93fa with SMTP id jz2-20020a17090775e200b0098e43ce93famr1716449ejc.8.1687710690762; Sun, 25 Jun 2023 09:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687710690; cv=none; d=google.com; s=arc-20160816; b=OsunPanIixtJS4LvO7Dz+NWMqsARwTalYR2PGSLLscAMUG89hAP7WFuNuGhDPOCymd Yw7R1FIK1DyHjPPvYyi1csv+hfwC8oE4d2yi6pOR+iWxh3imsZdMfH41MwLZar9okGoq nQKatXNoKUPu3LQmknfZtP42BqoRMWYQAOCfa4BclS+3zoeXQu4nSgDpyH21d1yPhxdF HAEnLX0w8syEks4tiW+LyUD3UcGiK1TS+3VYqrZDZsaBKbYFpJeWlYG16CBRS7aGRBVx KKV6goNEH/y1opCliMENzB+5/a25EI5TkfMKyGuuNo6lzjPt8lGTVu40gdC+5odK3+wq X+6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wzpB2JeeP/+5LJQoX+DM+hKB46MUVJk8x7crRJkVgqQ=; fh=9JCOumVf9dngCFHiV6Hmkcm2vnKQxEc42icPYm2blNQ=; b=Nx8MJgMuJoMJ/7b0XbNd3bUbTZLQz7DPOhS01Qdvbj5AeeRzHhMFFC0bbCprSfVR9i dE1lP6LfKQ+K7g86iloZugNeJ2twlk7KuaTPyI+HBlF5y3YypROmyjxdI2S/q44nMyoX hZtGJ7vE3j8QsHS/1KyzpRsvcL28XesrQ7FtdiEGNmlALwAanA/fgABwPlOxKq1ReAJL 49odJFF3QXsBrlxc2KZUYdTlt92atIs0CVwelJoM6IcSmMMQd9Qgs3W5tmMkt5NiUQZa gKAeNG8RxYEmlokgxqoVTXkTlCLjVJS5ySDSmda0KJ+GUeSKBXcD+TdrJ987d9jx1KCX mJJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=trHNOk0o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a50fe8d000000b0051beec1b3f3si1637769edt.500.2023.06.25.09.31.06; Sun, 25 Jun 2023 09:31:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=trHNOk0o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231670AbjFYQ3v (ORCPT + 99 others); Sun, 25 Jun 2023 12:29:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbjFYQ3g (ORCPT ); Sun, 25 Jun 2023 12:29:36 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F53197 for ; Sun, 25 Jun 2023 09:29:12 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-510d6b939bfso3428791a12.0 for ; Sun, 25 Jun 2023 09:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687710528; x=1690302528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wzpB2JeeP/+5LJQoX+DM+hKB46MUVJk8x7crRJkVgqQ=; b=trHNOk0opvYLVYmVhzWT2Po6oKItnmcPPNCDu1Fx2rMr8oCf1DH/9UCFefDEAKU+Ky AKS4L4xB1IOig9scwrJH7yctsWIPoE4nIkf6I8UrGBlOx9Iu9SN/Xw7lJBRa6K4GH/OH ai8TkQzbEqsHroNbB1V3M9DD9yNwvK3tXiw/uXgT+Ogo5sbVW6g+oCYn2c453Nqd3zVB v9ShFIjp2rqleT3Iv8/HCuNFcvPIlU11NtGmdz5Et7PSZcxIfrcLU+ftp0EO3e6T6r+N 6WSwG4pSp1v6Ve2gQL00M0XoZYf8+XE4FrWVhQJI0OHJqc+qYe8tu769sjRaZVsuSYxe Kb9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687710528; x=1690302528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wzpB2JeeP/+5LJQoX+DM+hKB46MUVJk8x7crRJkVgqQ=; b=duuneWUcLXxbOwaFayXFm02FxPSAfp6RjZeNVvVBZawqZoT5joUErA52plwYy8eobb YILD2KWIJPUwM7mzHuelBsaCZg8yg7vRY6TLToZtCkX9e1UH9RhwS7myIB4Isyu2TWnR GdOXX22DcFNQ57CtIq91ZMPtNU2TBtsXdC6RPKpo8ErD+oyrRHFx6LENKDQ5LwCg/HsB WevxxZrfiNosUA2ZRsouufhvphwysa2Ck8BhYudZ7CRcY6cutw0gXwIYoHC5YmuNppoK RQS6B9Mo9+jT1JhKKwKGqhs6H+mLYxdzgm8hhibCYYQmPOJenOda8oqm4LDkbwfXRNbY Ig0Q== X-Gm-Message-State: AC+VfDwJZFJkET1JusPZECB0NaNdyAnptgRhNtqoj2AgNv+wfwb/LrFm 0q3vqENCbWrSkKjjLtxbkhGJ+g== X-Received: by 2002:a17:907:7256:b0:988:56d1:10d8 with SMTP id ds22-20020a170907725600b0098856d110d8mr19292632ejc.53.1687710528697; Sun, 25 Jun 2023 09:28:48 -0700 (PDT) Received: from krzk-bin.. ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id ec10-20020a170906b6ca00b00982be08a9besm2277731ejb.172.2023.06.25.09.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jun 2023 09:28:48 -0700 (PDT) From: Krzysztof Kozlowski To: Dmitry Torokhov , Hans de Goede , Linus Walleij , Bastien Nocera , Sangwon Jee , Eugen Hristev , =?utf-8?q?Mika_Penttil=C3=A4?= , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Andi Shyti , Andy Shevchenko , Krzysztof Kozlowski , Andy Shevchenko Subject: [PATCH v4 14/24] Input: melfas_mip4 - Simplify with dev_err_probe() Date: Sun, 25 Jun 2023 18:28:07 +0200 Message-Id: <20230625162817.100397-15-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230625162817.100397-1-krzysztof.kozlowski@linaro.org> References: <20230625162817.100397-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769692925070365060?= X-GMAIL-MSGID: =?utf-8?q?1769692925070365060?= 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 Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko --- drivers/input/touchscreen/melfas_mip4.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index 32896e5085bd..2ac4483fbc25 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -1451,13 +1451,8 @@ static int mip4_probe(struct i2c_client *client) ts->gpio_ce = devm_gpiod_get_optional(&client->dev, "ce", GPIOD_OUT_LOW); - if (IS_ERR(ts->gpio_ce)) { - error = PTR_ERR(ts->gpio_ce); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "Failed to get gpio: %d\n", error); - return error; - } + if (IS_ERR(ts->gpio_ce)) + return dev_err_probe(&client->dev, PTR_ERR(ts->gpio_ce), "Failed to get gpio\n"); error = mip4_power_on(ts); if (error)