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: 109427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1831443vqr; Sat, 17 Jun 2023 00:28:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Ig6Igte+1FQ17eG7HHlPm2UGNbja7d1duWAAde5GG67RAiER5wWWiL4rcTIng92MI/02D X-Received: by 2002:a17:902:da87:b0:1b5:1adb:f43c with SMTP id j7-20020a170902da8700b001b51adbf43cmr5592552plx.23.1686986922191; Sat, 17 Jun 2023 00:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686986922; cv=none; d=google.com; s=arc-20160816; b=goBvhQAxLQcX49WNLuWkzjBwGVKikG/wUm0DTno07oqzgnPIvTdW0Fd8n0W56G4f8e AMYMWX7D+oUVzdmzc6tl/olO5vMzDV8XQOdQSqArMQxvtEIxc9DeCQNnTFD9aYr//sjs WMJcyU0539amnHy9cLEWb1cm9VFG/bw6mAO+okvxd3swCCtLa4P9vG7QOltuMYyKWFKy w8HyZdcmwh1BDO1KjuWtZj45KR3EA0wBFRJlAc3j1XA9AEjEI6jfKMgizrLuoK3Wl4Rf D6oplZ4N0O5wp1TnoH6PA+cyDdUKzakiQ9dJFEcTKqqMRG2HfkJWT1rbk6t4qVfuBi/m k0UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uwjvZj5RduTr+IL/itfPrhtkCpiCiq3BjJuJN5U78E8=; b=w6rxbwFPfwGYVMu/eewzei02/0eMS+j4Wa568sCnetojY5e2tIs2gtDRKQauT8LSt0 KmnGuZxvGZFhKudNdU0MzkjrZDU0g0baG3hl6xzCPmm3eb2KIsPZiJSRHRZrIIx+p9v0 HnA2UfD+igwEq0+ASeXI4omf+5Zqjp2iUebOOtF7WlLZbSHUuN5FTfEH8pRQJ5MV553C 1emq+ATUZJaFXr1VWLtYn7Xgx9xdTLZezz16e4avs0b5eh/bFx50kbyOjTjzRu4JZRwM MnGmHZd+yHMlr12LZMvnn7cTkFiik2S5WQyNXBnxmdwlHPINdQhyq0jTtB9Zns6Mvree QRYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="Q/XB/le1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20-20020a170903005400b001b049396666si15568501pla.601.2023.06.17.00.28.29; Sat, 17 Jun 2023 00:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="Q/XB/le1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234425AbjFQHMK (ORCPT + 99 others); Sat, 17 Jun 2023 03:12:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231929AbjFQHMI (ORCPT ); Sat, 17 Jun 2023 03:12:08 -0400 Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBAC211D 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768933999180589098?= X-GMAIL-MSGID: =?utf-8?q?1768933999180589098?= Use devm_regulator_get_enable() instead of hand writing it. It saves some line of code. Signed-off-by: Christophe JAILLET Acked-by: Michael Hennerich --- 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;