From patchwork Wed Aug 26 18:16:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739271 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 AA2181731 for ; Wed, 26 Aug 2020 18:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 887AF22B43 for ; Wed, 26 Aug 2020 18:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465847; bh=S63b8jH3yXPTdFcjM0wgK1kGIdL/qW7ae7J48kYeDyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P18uogbAF7mYzU71yaZ3blN/sgaKhiPpUmAtfwDiMptJH56qeXAUGDyTjhDEdoyGN Z3lrRqmn5H/282FNfeGhhhueLCBjVit8s34WfJW2DUDDnqZVZlZm+WY3kYb3jNOox/ ErP/2JpskMBsa7eVDkvxbiEKV/sMxRfYc5gZze8Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726845AbgHZSRY (ORCPT ); Wed, 26 Aug 2020 14:17:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:39590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726818AbgHZSRV (ORCPT ); Wed, 26 Aug 2020 14:17: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 892E020786; Wed, 26 Aug 2020 18:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465840; bh=S63b8jH3yXPTdFcjM0wgK1kGIdL/qW7ae7J48kYeDyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TIjMx1lppHHDR7v9UebK4nY3MBUuPIMmGHoBMm5ceEhguzm3KolsI1hBRP2xWwTb0 LVn0YIhj2IZBnVUq7CwOJxQ+oNMy+pnArbP2XDTVKWKxNsriOktu8k/AC544MgHmef vEMcloJdXskKDGsWwlVwbdRm1v11SWVxrUihLk7g= 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 02/24] Input: gpio_keys - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:44 +0200 Message-Id: <20200826181706.11098-2-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 --- drivers/input/keyboard/gpio_keys.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index f2d4e4daa818..6f670cbe8a8b 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -505,10 +505,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev, */ bdata->gpiod = NULL; } else { - if (error != -EPROBE_DEFER) - dev_err(dev, "failed to get gpio: %d\n", - error); - return error; + return dev_err_probe(dev, error, "failed to get gpio\n"); } } } else if (gpio_is_valid(button->gpio)) {