From patchwork Wed Aug 26 18:16:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739349 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 5ABA4138A for ; Wed, 26 Aug 2020 18:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36DEB20786 for ; Wed, 26 Aug 2020 18:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598466001; bh=/MVD81Dk9a9N8i8v4eBsnioXxC7T8r+SLsxSVtXZhEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=otQXPCDpDVfDLjIm9isTESiQjJsK1uQiSPCFcaBH9lRaoYK4jCy23NoAUgLtuGyCS FSTVCpiHvC+g4u9qBqPfe/lrd+wv6OCWcJuQs75EGlr9NwuLck/9bh7bnhWSojxZKd v/X81cc6zvaIB13vgKuZm07wH49SDvbKIhd1kKtc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727851AbgHZST6 (ORCPT ); Wed, 26 Aug 2020 14:19:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:41926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbgHZSSV (ORCPT ); Wed, 26 Aug 2020 14:18:21 -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 EE49C2083B; Wed, 26 Aug 2020 18:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465901; bh=/MVD81Dk9a9N8i8v4eBsnioXxC7T8r+SLsxSVtXZhEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a5whlNufmpP7lRPlL+rG4uzwsAtu9iYP3on3k/DYmbaOa9YW3+AFwZq7f+T/8luiA hHsJ1uIQ81vCNO8Q/rgvmt5cf3vY13wrCqoUPOrcYhWsrOKNqIBcZgYw57qoubbZcU BreZZCgcxExZXnCjzjBGvs/iP4Rf9JAqMHaUDO8w= 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 13/24] Input: edf-ft5x06 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:55 +0200 Message-Id: <20200826181706.11098-13-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 --- 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) {