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: 11741405 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 D39B113A4 for ; Thu, 27 Aug 2020 19:00:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BACBE2087C for ; Thu, 27 Aug 2020 19:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598554844; bh=E/Nqu7k08v69pmYNgRfgpit87lGs45F9vZiVl/29fKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jssYWQeQk+PZIbpwTZFE+SRQ63E0cgu/d1TQM2svJQBx3I/aTukfniaBPTPNfpuPr qh+jWLG3yiC45u2QsEYNUvpwVt5lg1ovBlcKRkORwhThXm4Vn5c1VNTmHv9pKKQBSj auaXly+esQwz1PmAC1zmG7bRlpkbBg/dZN4d90wo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728054AbgH0S7U (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: 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: 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) {