From patchwork Wed Aug 26 18:16:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739301 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0EEE813B6 for ; Wed, 26 Aug 2020 18:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8DE622B43 for ; Wed, 26 Aug 2020 18:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465906; bh=aDmvqHlQZkrMxJWIZ3K/qfQvR2zitB02kM6hwU97zPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GesbRufqEJNRNZSWBJFph6iDL1SlmMd60w2sVWVmSrizByIhd62KSpHXrqu27L/IZ tlJp4RQLm/TwI0ljpWkBjY1rkhMrTDdBN2HoyODnJKa2Db8XRbMjEuRHpKeFV3ppVQ KEJhVgke3P4EYJgWo+tDrVKvWlw3V/Tsx6BbjeCk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727786AbgHZSSS (ORCPT ); Wed, 26 Aug 2020 14:18:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:41704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgHZSSQ (ORCPT ); Wed, 26 Aug 2020 14:18:16 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5EA76207BC; Wed, 26 Aug 2020 18:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465896; bh=aDmvqHlQZkrMxJWIZ3K/qfQvR2zitB02kM6hwU97zPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xsiumwCLu2SlMtdlk+MK3PTQ2NzSAgquDGVZLE1MAaGAIz0G3kswIPur0kr7hpe1T X1dsyEb0pmVZAmL2HFrv7oAE4BR53+PwzLSs7f7KdhWfz6yh2og9PJNOVUbR8GYBy7 bydwX79WwjbYLTQyZZg1JiVrcAKd4wr/0pOho1uc= From: Krzysztof Kozlowski To: Dmitry Torokhov , Hans de Goede , Linus Walleij , Bastien Nocera , Sangwon Jee , Eugen Hristev , "Gustavo A. R. Silva" , Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 12/24] Input: cy8ctma140 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:54 +0200 Message-Id: <20200826181706.11098-12-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826181706.11098-1-krzk@kernel.org> References: <20200826181706.11098-1-krzk@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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: 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 a9be29139cbf..23da5bb00ead 100644 --- a/drivers/input/touchscreen/cy8ctma140.c +++ b/drivers/input/touchscreen/cy8ctma140.c @@ -259,12 +259,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)