Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1067014rwb; Thu, 4 Aug 2022 16:43:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mKGRMZlN26CNLGXm0NE9LWpJZLKXDCR+rEjnor3G6r/U2mpFzqKtiiX/aDq2MsZBMapej X-Received: by 2002:a17:907:7e9c:b0:730:a788:a6d1 with SMTP id qb28-20020a1709077e9c00b00730a788a6d1mr3154754ejc.9.1659656600550; Thu, 04 Aug 2022 16:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659656600; cv=none; d=google.com; s=arc-20160816; b=SqaHY7UCaIJciOpEuGtilK3gkjTsgkbbirV7CMP+skO29/JB4JI6P3A2Y45zCbVg7K OrPZNZL949Y/cnjIoMgJ62bw8gN7WBg+eUye7R6xhPgWoCBlOb2uvswAu5UzRAx3r8sw UqbYCDg/niECBXmjmaNgH2QyhDCFkkOpxUcsh+ClGk6E0dNJraNmdBwnbr4XCv3NqNSb 9YhtyWHJbM5lsPmBEtXE9v9T2bqko8jBz8gVhwvHK5QpKDEQI7OIiZttWxx7Ks/64emT bTqnT5yPE/v/66gb0zJTLp7GgkVH7afLKxrRkdEz4sN4HJjJ+iJVDPU5qr4KF+qyeGnM heJg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y6LxKgZwFvrUFcWeNV79IxBK5DkuqAc3CHWOKwe+2Kg=; b=rvnslKhiyZaYB9a7SRBnsty3PyimgrzYx5knQVadBl0gWJB+749kmNBdtZr6jCcCWQ O4wlkKGDuObM84f6N73f8Z4twEdKM5Z9hAnOxEDeDC4WjtzwXPI+ABHJn7JCvzAgudfi zbsJGcNRRb8X1z6jl+t4A1Zeut4gwd3jrvL6CTlHZCOd+ryn37fbdIhpkCMRxSaZIQWj +LpsuhRz4ki6UWEdNJtH5jFUT3JIX+pURG4YmmhYzuzTXMyXadRl/eN4w4vW11KeDP71 Z9UWit7mh7thHEAYxDzWf8S9ElYfNyxr3v6Rxer0/4nI1ntYbYrq9siyGqb2zWxMEvb3 9G5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=Id7pKweY; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a056402430e00b0043dda6fc807si2625608edc.498.2022.08.04.16.42.56; Thu, 04 Aug 2022 16:43:20 -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=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=Id7pKweY; 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 S240151AbiHDW4Q (ORCPT + 99 others); Thu, 4 Aug 2022 18:56:16 -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-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: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 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/max8973-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; } -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 = data; + struct max8973_chip *mchip = tz->devdata; unsigned int val; int ret; @@ -478,7 +478,7 @@ static irqreturn_t max8973_thermal_irq(int irq, void *data) return IRQ_HANDLED; } -static const struct thermal_zone_of_device_ops max77621_tz_ops = { +static const struct thermal_zone_device_ops max77621_tz_ops = { .get_temp = max8973_thermal_read_temp, }; @@ -492,8 +492,8 @@ static int max8973_thermal_init(struct max8973_chip *mchip) if (mchip->id != MAX77621) return 0; - tzd = devm_thermal_zone_of_sensor_register(mchip->dev, 0, mchip, - &max77621_tz_ops); + tzd = devm_thermal_of_zone_register(mchip->dev, 0, mchip, + &max77621_tz_ops); if (IS_ERR(tzd)) { ret = PTR_ERR(tzd); dev_err(mchip->dev, "Failed to register thermal sensor: %d\n", -- 2.25.1