From nobody Sat Apr 11 22:45:52 2026 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 422BDC25B08 for ; Thu, 4 Aug 2022 22:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240181AbiHDW4R (ORCPT ); Thu, 4 Aug 2022 18:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240290AbiHDWyv (ORCPT ); Thu, 4 Aug 2022 18:54:51 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0195A71BFB for ; Thu, 4 Aug 2022 15:53:08 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id bv3so1356967wrb.5 for ; Thu, 04 Aug 2022 15:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Y6LxKgZwFvrUFcWeNV79IxBK5DkuqAc3CHWOKwe+2Kg=; b=Id7pKweYUatJROorXv8gDRF6wOlhQYhoHYCgkiawGsi5z1/06p2q/2zVrrHjJJLL4+ cJfswWG9mCrhUj4ZKuNWoNX+fC3638GGqxxqmIHqJuDNziuEQDGjr1cuz2jISKJ/+Pzg SsYoEZKBeEUadva58HJM/00F5Gh0GPeOXzh8JeMgu4SsRXGxwRBnpLCuo/oc96bWpYzI ySepH49uraSqsJ6f9l/pvVNlVjG7QMvT/1ouzlRSMPHFQfNzDQDmzcG0wO75Dr7zSxOE squ2SZkwzow4QkW3fPr4qWvxZcpQp9QhCeRFPWDXYmHYQFmouYPcmcEv6srclO7gAg41 wF0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Y6LxKgZwFvrUFcWeNV79IxBK5DkuqAc3CHWOKwe+2Kg=; b=qWUcNH2IEw/+AZI05djnSbpK3y3TwpZNHVflaNcQZlYaYmIOpscyyLydIt2neZLcyI iqTVXOFQ5Re8myPyThm+XKVUndsc+mUAFpelBH20hwp117WvCWKY2Q++ujGEsA4hXFl2 VvxHlwfXetyM8lbB3VeQgHR/x+wnCaFCPBn72mWvy5FVQoEgbPsH5+1GHKgekVeu6aBS 6btghIYDEwjIdiD/GsLObKGhwnnuZrNTRW53cLkpwnMlEIun57gK7OWua8qbljyubQRK vkIQcNeeS+XEp8bNvdnRrlKFU89JR11fO6CcgRV7QQyC+M15YjoYFgvJHPF7kbAhSz1n H63Q== X-Gm-Message-State: ACgBeo2H6yqlyhd5PxCoW8GbrAFOq23ifNRLqDHZEMtxEaHjLUf/x/lx FfjT+FhOQRFEybqLNujoKHB7VA== X-Google-Smtp-Source: AA6agR6C7kB9euhycbz6D2Hp/WjyYK2+u2NklN5QEy26sFT93OJIpIYnk3FMTGQ8ir7oO6wiI2oZYA== X-Received: by 2002:adf:efc3:0:b0:21f:15aa:1b40 with SMTP id i3-20020adfefc3000000b0021f15aa1b40mr2560700wrp.159.1659653587248; Thu, 04 Aug 2022 15:53:07 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:31aa:ed2c:3f7:19d]) by smtp.gmail.com with ESMTPSA id a16-20020a056000051000b0021f87e8945asm2495906wrf.12.2022.08.04.15.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 15:53:06 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, abailon@baylibre.com, lukasz.luba@arm.com, broonie@kernel.org, damien.lemoal@opensource.wdc.com, heiko@sntech.de, hayashi.kunihiko@socionext.com, mhiramat@kernel.org, talel@amazon.com, thierry.reding@gmail.com, digetx@gmail.com, jonathanh@nvidia.com, anarsoul@gmail.com, tiny.windzz@gmail.com, baolin.wang7@gmail.com, f.fainelli@gmail.com, bjorn.andersson@linaro.org, mcoquelin.stm32@gmail.com, glaroque@baylibre.com, miquel.raynal@bootlin.com, shawnguo@kernel.org, niklas.soderlund@ragnatech.se, matthias.bgg@gmail.com, j-keerthy@ti.com, Liam Girdwood Subject: [PATCH v5 30/33] regulator/drivers/max8976: Switch to new of thermal API Date: Fri, 5 Aug 2022 00:43:46 +0200 Message-Id: <20220804224349.1926752-31-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804224349.1926752-1-daniel.lezcano@linexp.org> References: <20220804224349.1926752-1-daniel.lezcano@linexp.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano Acked-by: Mark Brown --- drivers/regulator/max8973-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8= 973-regulator.c index cb7e50003f70..61211c462b1a 100644 --- a/drivers/regulator/max8973-regulator.c +++ b/drivers/regulator/max8973-regulator.c @@ -447,9 +447,9 @@ static int max8973_init_dcdc(struct max8973_chip *max, return ret; } =20 -static int max8973_thermal_read_temp(void *data, int *temp) +static int max8973_thermal_read_temp(struct thermal_zone_device *tz, int *= temp) { - struct max8973_chip *mchip =3D data; + struct max8973_chip *mchip =3D tz->devdata; unsigned int val; int ret; =20 @@ -478,7 +478,7 @@ static irqreturn_t max8973_thermal_irq(int irq, void *d= ata) return IRQ_HANDLED; } =20 -static const struct thermal_zone_of_device_ops max77621_tz_ops =3D { +static const struct thermal_zone_device_ops max77621_tz_ops =3D { .get_temp =3D max8973_thermal_read_temp, }; =20 @@ -492,8 +492,8 @@ static int max8973_thermal_init(struct max8973_chip *mc= hip) if (mchip->id !=3D MAX77621) return 0; =20 - tzd =3D devm_thermal_zone_of_sensor_register(mchip->dev, 0, mchip, - &max77621_tz_ops); + tzd =3D devm_thermal_of_zone_register(mchip->dev, 0, mchip, + &max77621_tz_ops); if (IS_ERR(tzd)) { ret =3D PTR_ERR(tzd); dev_err(mchip->dev, "Failed to register thermal sensor: %d\n", --=20 2.25.1