From patchwork Thu Aug 27 18:58:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741339 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 73492739 for ; Thu, 27 Aug 2020 18:59:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51C8422BEA for ; Thu, 27 Aug 2020 18:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598554761; bh=E/Nqu7k08v69pmYNgRfgpit87lGs45F9vZiVl/29fKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=D27hGmJCGZHa964wpWlHht72Zzs4kGx33kFu2pdak54m2cmFA8qbUR6g7RJkfMrcd 9Sq0iuO0v/6D8/eADWGc4NIAUyg51rc5JJAxuR6pdvmaL2D2exxwaR1hw8VaxHLk11 HsabN0/gPa/HtFlrvoduGtFRaMoUOrCtTxGKNAXY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbgH0S7U (ORCPT ); Thu, 27 Aug 2020 14:59:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:49508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728051AbgH0S7T (ORCPT ); Thu, 27 Aug 2020 14:59:19 -0400 Received: from localhost.localdomain (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 0DF6522BEA; Thu, 27 Aug 2020 18:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598554758; bh=E/Nqu7k08v69pmYNgRfgpit87lGs45F9vZiVl/29fKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hadf1zyBhyuvwF6HlnRT6CWcw3uccgLCRNPwEn/21cy/oAfLzxahL6ff10c3qh/TU kfcqCx3hdEm1oPPWznU0kyRcJXR04ZBldWzEFS54dBplZPC5x4k7G3soobrkuMjsYY VKFl8b5cN8mLjcSzxlLq3oTMVsfG1SHBmKquMLGI= From: Krzysztof Kozlowski To: Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Hans de Goede , Bastien Nocera , Sangwon Jee , Eugen Hristev , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org, clang-built-linux@googlegroups.com Cc: Krzysztof Kozlowski Subject: [PATCH v3 11/27] Input: edf-ft5x06 - Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 20:58:13 +0200 Message-Id: <20200827185829.30096-12-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827185829.30096-1-krzk@kernel.org> References: <20200827185829.30096-1-krzk@kernel.org> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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: Hans de Goede Reviewed-by: Andy Shevchenko --- drivers/input/touchscreen/edt-ft5x06.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 6ff81d48da86..d4827ac963b0 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1098,13 +1098,9 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, tsdata->max_support_points = chip_data->max_support_points; tsdata->vcc = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(tsdata->vcc)) { - error = PTR_ERR(tsdata->vcc); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "failed to request regulator: %d\n", error); - return error; - } + if (IS_ERR(tsdata->vcc)) + return dev_err_probe(&client->dev, PTR_ERR(tsdata->vcc), + "failed to request regulator\n"); error = regulator_enable(tsdata->vcc); if (error < 0) {