From patchwork Sat Jun 17 07:12:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 694323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D860EB64DB for ; Sat, 17 Jun 2023 07:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233026AbjFQHMI (ORCPT ); Sat, 17 Jun 2023 03:12:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjFQHMI (ORCPT ); Sat, 17 Jun 2023 03:12:08 -0400 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC1B213B for ; Sat, 17 Jun 2023 00:12:06 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id AQ6OqsOdNhQKVAQ6OqaPHj; Sat, 17 Jun 2023 09:12:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1686985925; bh=uwjvZj5RduTr+IL/itfPrhtkCpiCiq3BjJuJN5U78E8=; h=From:To:Cc:Subject:Date; b=Q/XB/le1cPA7lV0lwHKtheheqImQ1ZC+UbmBb0RrLc5UUPy0ApWfj8i+ezLJggG61 MrPi/9TLFjqBilDykja7HpJCw9l0Ys1/tpSW0E1ShgsgKWHVl26PLf+HLxY0/WzZGN 0I/RbY3K0/VvylXKDIb0Js6FWQfR7GC8sPCC6C4t66qaQy55ZxoW4Zv0jtJcGa9qcX hwkfloujL0ivqu1ygVejbFVMGc7IZW4VskCT5IgA3ofTSCTcQkq4e1Mjz9cePLCu71 RZquMs4za+u16/DKyE3eBKvCH3aX4WZnFyaEkSKoRziCaA1y2Nn/MLLytcLDPjuEVZ gfPZLMLPt13HA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 17 Jun 2023 09:12:05 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Michael Hennerich , Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-input@vger.kernel.org Subject: [PATCH] Input: adp5588-keys - Use devm_regulator_get_enable() Date: Sat, 17 Jun 2023 09:12:03 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Use devm_regulator_get_enable() instead of hand writing it. It saves some line of code. Signed-off-by: Christophe JAILLET --- drivers/input/keyboard/adp5588-keys.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index 896a5a989ddc..61e8e43e9c2b 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c @@ -713,17 +713,11 @@ static int adp5588_fw_parse(struct adp5588_kpad *kpad) return 0; } -static void adp5588_disable_regulator(void *reg) -{ - regulator_disable(reg); -} - static int adp5588_probe(struct i2c_client *client) { struct adp5588_kpad *kpad; struct input_dev *input; struct gpio_desc *gpio; - struct regulator *vcc; unsigned int revid; int ret; int error; @@ -749,16 +743,7 @@ static int adp5588_probe(struct i2c_client *client) if (error) return error; - vcc = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(vcc)) - return PTR_ERR(vcc); - - error = regulator_enable(vcc); - if (error) - return error; - - error = devm_add_action_or_reset(&client->dev, - adp5588_disable_regulator, vcc); + error = devm_regulator_get_enable(&client->dev, "vcc"); if (error) return error;