Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp383147rwi; Mon, 31 Oct 2022 02:40:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4fdhkEJBpLH+Ab2C/ICleNf/+1E2ti/U/JiQRhSLoL+oAOKtH+hrMi7mqOQdyS8D1+aO4o X-Received: by 2002:a17:90a:7061:b0:213:da75:f149 with SMTP id f88-20020a17090a706100b00213da75f149mr5767225pjk.85.1667209235675; Mon, 31 Oct 2022 02:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667209235; cv=none; d=google.com; s=arc-20160816; b=BIVq8/3jskOHT1/SuZY59l3qLAVkWXq8WFHocaI6FtR5ogxj1jqbiPSm+KeCXHvvqI bV8Es85nqXSKTRSAPnfm0+My602qfmFXBviU/XpJS+op2sTvarjp8o/+gkBhO7je+ZH+ 6C/KiqvrQ+rWiqtsP7PCfQ5nbWTlVyy+3RCeW8L38tYGLDc8fgRHkBhwP5cBwLFlFPbN psQeihMLKphrGLolKr+ii/QaUQ+347EXf65n4XHqPPLcspoSAZm58l1eeBabcY8ea3L1 hbN3GG7Il9fPOW/R0cvFr87WjiSnRFs6bUpR1mvCliGC8szo70kgjeBZaMaLDdMzLHUs lLIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=6WU26MBOt8WJip0LsF+/o2BON0nZWtJO9/skfyzMYys=; b=NZHC1UeqGij6Iu6XhhyDH6bRPvRycQ84HdNyD0H7n4GmxlD+R9r7k4ehsc8ik2dE8I KWuMcz/P6hmsL4BheVAADp5U9Ff1aLBVR+qSb9SwsVNyhEPOmWyjMTFaGkPwBBFeacen Ta1uh19pQQsZH8solIelYGRS6MZHDJin2+TlbqhaZfIUU1H8snOghW8aoYzUlSZhdyUe 1TWsE/bduO5K1jNARW4HLa/doZO/JOFMboYb/s13rzqUiIVQZ6EhAAPqwyGMWr1oFiTT CKGhGiep+VFmlTIOcCgXtk2JBFi4mU0qO4TnUlYNZQ7PAEhWSgPiwt3ZEwyFlcUDKqJ6 66SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=l9Ec6Z3p; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a170902b49400b00178b88d40ebsi6749648plr.51.2022.10.31.02.40.21; Mon, 31 Oct 2022 02:40:35 -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=@gmail.com header.s=20210112 header.b=l9Ec6Z3p; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229787AbiJaJZ3 (ORCPT + 99 others); Mon, 31 Oct 2022 05:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbiJaJZ1 (ORCPT ); Mon, 31 Oct 2022 05:25:27 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D28865C0; Mon, 31 Oct 2022 02:25:26 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id j16so18260312lfe.12; Mon, 31 Oct 2022 02:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=6WU26MBOt8WJip0LsF+/o2BON0nZWtJO9/skfyzMYys=; b=l9Ec6Z3pCXkd/0PTcwHkH7+fM6BIWq9SSTBElCmHDmP12O19aP/1XUl2kowGBBfSU5 SOxQ/i+u9Vgo1beE6pzWMWl3fTxd/ZjV+Yr0Kx8Y80OSmj9Tn1PecncY5g4FDnKqAbxL eM3nqIt+vxJmx1KKet+q7PJY8XH2IZeoUCDYft69i36rS7iL/lstV1faHoQIpIOLolg+ OAKeADCXW7ZXzf8JijPKPbptu+c5Kvhmz9D+biGjBxcdo6IvfHZvUaDnD4/2KvWWRjS2 BB0Ooas8nyXPXLJ76DjhtD8enNTPyOeQZNhIRVAAhGbjqFNJf3U30CqiXSH6zebSH57j pG+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6WU26MBOt8WJip0LsF+/o2BON0nZWtJO9/skfyzMYys=; b=yANXHbJWDPBt3YZkA2/4a+tWOqeMNPNNDpmye2IgnA5uoefFYV5rSZihtGMglLSvJP hCW22xPOJjN/5QAtCc+qo525448lOkn39HQlen5u6na7irtv3sxM73EkNitmmX6zQIob hHzYk5VUJ+MTBgeGf9/HsehqeQH5GvGDUSaW44YLLW54gm3ilDMvTFxiQZcZ/oC1STuD /khj+UVgzvFXUALtVPD6LM9N2YosSsDWhEQz+/9Cql9GewGFx/OfkCtNouRJWWPoZon2 uGaEZ0m/e8f50DcINuH4zJ3ayl1P3z5edOmosy3HhzQWRUoHHnAm6hGwBVc996GQbI4R dTUg== X-Gm-Message-State: ACrzQf2oydC2B7HCjo68aN5P/+uRtpY6rk3kZlRdrEHPV7DWHez9KMMl 3axdzqgPpJ7N8To05R6julw= X-Received: by 2002:a05:6512:6d4:b0:4a2:f89:db7d with SMTP id u20-20020a05651206d400b004a20f89db7dmr4718215lff.125.1667208324715; Mon, 31 Oct 2022 02:25:24 -0700 (PDT) Received: from dc75zzyyyyyyyyyyyyyby-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyyby-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::2]) by smtp.gmail.com with ESMTPSA id 190-20020a2e05c7000000b0026f9cb6d10fsm1239260ljf.45.2022.10.31.02.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 02:25:23 -0700 (PDT) Date: Mon, 31 Oct 2022 11:25:00 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Sebastian Reichel , Matthias Brugger , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] power: supply: mt6360: Use LINEAR_RANGE_IDX() Message-ID: <2c6267efae04a3f64d88baf2e34ea309af438d40.1667208242.git.mazziesaccount@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="spmfeW7Hd1DSSs/Y" Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 --spmfeW7Hd1DSSs/Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Do minor clean-up by using the newly inroduced LINEAR_RANGE_IDX() initialization macro. Signed-off-by: Matti Vaittinen --- Sorry, this one evaded my original grep so sending an individual patch. Would've squashed this with bd99954 one if I spotted it right away. --- drivers/power/supply/mt6360_charger.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/power/supply/mt6360_charger.c b/drivers/power/supply/m= t6360_charger.c index 3abaa72e0668..92e48e3a4853 100644 --- a/drivers/power/supply/mt6360_charger.c +++ b/drivers/power/supply/mt6360_charger.c @@ -113,16 +113,13 @@ enum { MT6360_RANGE_MAX, }; =20 -#define MT6360_LINEAR_RANGE(idx, _min, _min_sel, _max_sel, _step) \ - [idx] =3D REGULATOR_LINEAR_RANGE(_min, _min_sel, _max_sel, _step) - static const struct linear_range mt6360_chg_range[MT6360_RANGE_MAX] =3D { - MT6360_LINEAR_RANGE(MT6360_RANGE_VMIVR, 3900000, 0, 0x5F, 100000), - MT6360_LINEAR_RANGE(MT6360_RANGE_ICHG, 100000, 0, 0x31, 100000), - MT6360_LINEAR_RANGE(MT6360_RANGE_VOREG, 3900000, 0, 0x51, 10000), - MT6360_LINEAR_RANGE(MT6360_RANGE_AICR, 100000, 0, 0x3F, 50000), - MT6360_LINEAR_RANGE(MT6360_RANGE_IPREC, 100000, 0, 0x0F, 50000), - MT6360_LINEAR_RANGE(MT6360_RANGE_IEOC, 100000, 0, 0x0F, 50000), + LINEAR_RANGE_IDX(MT6360_RANGE_VMIVR, 3900000, 0, 0x5F, 100000), + LINEAR_RANGE_IDX(MT6360_RANGE_ICHG, 100000, 0, 0x31, 100000), + LINEAR_RANGE_IDX(MT6360_RANGE_VOREG, 3900000, 0, 0x51, 10000), + LINEAR_RANGE_IDX(MT6360_RANGE_AICR, 100000, 0, 0x3F, 50000), + LINEAR_RANGE_IDX(MT6360_RANGE_IPREC, 100000, 0, 0x0F, 50000), + LINEAR_RANGE_IDX(MT6360_RANGE_IEOC, 100000, 0, 0x0F, 50000), }; =20 struct mt6360_chg_info { --=20 2.37.3 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --spmfeW7Hd1DSSs/Y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmNflF8ACgkQeFA3/03a ocUITQf/Vr2UgDLY58WdZKQDMEovsWmrPfqqvVaI8lXvunXIoru48z0u5F1LPzev X65VfIgyQ4rrH+sbgBpatfqcMP9EsIe0Qu9oDEAu97ycfO4iNiWHHJKxvqqim/D2 gDu1jgH+zlgtSp/N5QKCH7R1157yQ96JFIP6Ka4Tr7LQcgjQGoygS51wMNF3G41b MaMmrXM6ZqDNuaMOOhXMo7MQd1NGO2wAFU6bQt9KoGbHNTMM68NMlowyHIE/pLJc 5ysNufmSt5NkIEhLO0SkQNkeUYoerb4mBRYfshBlonftVuFkpcLQqyec+KAyMbRo 6zM/giLvVS8M3NJy2I514PmoEYCENA== =KmNS -----END PGP SIGNATURE----- --spmfeW7Hd1DSSs/Y--