From patchwork Sun Jun 25 16:28:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 112642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6997556vqr; Sun, 25 Jun 2023 09:31:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5LZ/zvjo3eZ0MVX9jYAmJ/vZ8gDKUX+2BXXZ6O7wxNm9CJbUktFdOJKlUP8rAqO8mSRy0f X-Received: by 2002:a17:906:3084:b0:98d:696a:531c with SMTP id 4-20020a170906308400b0098d696a531cmr6260146ejv.40.1687710660605; Sun, 25 Jun 2023 09:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687710660; cv=none; d=google.com; s=arc-20160816; b=qA09X4UUoSJyLAda3eDvAuBtFp2Ch8CCqh1B6d2r/QjZhMSlcNUIH9K+iGPVXi3UQo 2VJnSTbHEajhWO1dWE4FVm5TOh2OGT630kTKY9Cey6LiSBe6a6NVONHM31y4JIeVaIAI /wApu+jAy0cHe6E18RrOFjfxXWuPK5CDJsQgW0c1w2yFpfT+BjJ2hVK/mG0rAcyQcQGM JilKH3EOeCWPML52Ri3KJENa2C2MJcBYuU1Q7S8tFBA28GuYC0fJI0DSxoTEngy/EDuE sl+/nzjO6szrpU35kNuqnDqATQBolg/QoE6BieBVfce1XOtx7rjR9B38IZmeNJR0AyPg /L+g== 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=PO1VEj8PCt+SP2FLdSp8jHVPdvdkdeiUc+/c+qgri9c=; fh=9JCOumVf9dngCFHiV6Hmkcm2vnKQxEc42icPYm2blNQ=; b=NuojvZxkmWbvjkoOTeGk9WgqHVCWxBaRjCsG/5/NAk7rbp+WB2t314pumslzdMjUMR w6S8m7D1JNlWNSuRk6RFNpw+eB230ExBSoGHD3gsMt1StuYCTHJnz1/irlxG3oaDLqq7 cSHIeFsFci6+9VNDZXt9OxpxbEpxqOM4eOnZMDC6AHuv7ui2ivSOP9mio/JiAs7hqUJY DXdD68ESmgnRngWl6jHlwrxe5FmerEgLWIFXaBXL5BKF/KM98yEMx12kEA33m7VyRmBK qgaDzVQrSxSiyYFlHKYXDfvxvAkvNNfXXV3DeUKAlvhYUX8uOjfIH6YUuK62nFwTbOzc tQBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wTzGEi82; 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 uz14-20020a170907118e00b00970f0c11efcsi1855815ejb.339.2023.06.25.09.30.36; Sun, 25 Jun 2023 09:31:00 -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=wTzGEi82; 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 S231397AbjFYQ3P (ORCPT + 99 others); Sun, 25 Jun 2023 12:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231247AbjFYQ26 (ORCPT ); Sun, 25 Jun 2023 12:28:58 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83D9A1723 for ; Sun, 25 Jun 2023 09:28:41 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-98934f000a5so290909166b.2 for ; Sun, 25 Jun 2023 09:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687710519; x=1690302519; 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=PO1VEj8PCt+SP2FLdSp8jHVPdvdkdeiUc+/c+qgri9c=; b=wTzGEi828CVHhBinoiCuumo6mbuHwRBUt3VOGODKfCCVqZB0A4RejQPQFvJ/ypE65T dqsBOXIt9ozbLcZKz07P/ptiWeAr0yJGJ6Ggpghs2ef7Ccx6Y7V6TJpBkO0KqblTi0Tz gz2Lw3N1pDR8HW+tfohVXT3mMvs378/2sqbD7CYcMPALwctsmXgwRqhBUuQxcFXRL7nO /AJeFDR9ifwca54oC3MtU+y82lq4v5S6o7vjDqL2RnZkB0/nb42InuxsD06gE4ltJoCH yqNkKgNWKhl0PBnFCupHRzwpqIohIOPtZW7dcN2Uk9GVxx/smiuqjm3cengh/2ilY9Sp a7YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687710519; x=1690302519; 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=PO1VEj8PCt+SP2FLdSp8jHVPdvdkdeiUc+/c+qgri9c=; b=VhNxpWO0/vQHuix+UuX+uzFhr9ExSbHGQA9T3RIQsR0th1wqLSgcBH5xTC3voJ915J 9m1Ho4l4NefihujyF/F8DnxQbnhMNm5ciM3PE0gp2c7mwmVfw/8R+mHbhLTPBa/6v/pn qga+35roH33QGIWoQNVvGZZDa65pBh5uJZCC5TzP7U9DYkPtmivW5rP6aCsfWhXTM62s TjXsMordFa7jpmoQGZwOjyBSR7PpsYANRcba3UTF4zoC9X50P63hsTsT2QjBAP2p4vI+ pEcaUSnfXmagwWPID9NJqVU6BSX4w6ej0BPHeAopzEvuwP82foZHZn73/CzPOsjkt5xl fXhw== X-Gm-Message-State: AC+VfDySQs/3JnzdOj/MWpvvkYfDzEN/1h9pfFF5/Qcb+lbeDMtCqcV5 TmbsyXXqQqsFnWxEYinxe8lLZQ== X-Received: by 2002:a17:907:5c2:b0:974:55a2:cb0b with SMTP id wg2-20020a17090705c200b0097455a2cb0bmr23869630ejb.55.1687710519450; Sun, 25 Jun 2023 09:28:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jun 2023 09:28:39 -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 09/24] Input: cy8ctma140 - Simplify with dev_err_probe() Date: Sun, 25 Jun 2023 18:28:02 +0200 Message-Id: <20230625162817.100397-10-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?1769692893233594137?= X-GMAIL-MSGID: =?utf-8?q?1769692893233594137?= 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 Acked-by: Linus Walleij --- drivers/input/touchscreen/cy8ctma140.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/cy8ctma140.c b/drivers/input/touchscreen/cy8ctma140.c index 967ecde23e83..ea3895167b82 100644 --- a/drivers/input/touchscreen/cy8ctma140.c +++ b/drivers/input/touchscreen/cy8ctma140.c @@ -258,12 +258,8 @@ static int cy8ctma140_probe(struct i2c_client *client) ts->regulators[1].supply = "vdd"; error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->regulators), ts->regulators); - if (error) { - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to get regulators %d\n", - error); - return error; - } + if (error) + return dev_err_probe(dev, error, "Failed to get regulators\n"); error = cy8ctma140_power_up(ts); if (error)