Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2190172imn; Mon, 1 Aug 2022 14:43:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR5gv+ldb/rVNUfSrgxqmqHxeyzSkxc5P51Ouemopcelqv/8nMdpNKYVHfs9Ei+KVkkY90r/ X-Received: by 2002:a17:90b:4cc4:b0:1f4:eec1:e168 with SMTP id nd4-20020a17090b4cc400b001f4eec1e168mr10487878pjb.116.1659390211187; Mon, 01 Aug 2022 14:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659390211; cv=none; d=google.com; s=arc-20160816; b=SgVUiJi1jb55yV7/iN6atuf1m1Fwmx9jw++fjf+BTlPK9xECH1LfWN967nWEuNqoxf PxA3yypWffboYilXQviKZ65P0DzXdaJU254JHC/ox6UzAm/NVwOG3v7aQ5QLYiiQk66l Qb0kHBn26vGkrd/oNaT1QkcvL3sPDGLxXBLxiDz7Z++4U8QjEmOlzKsAnMVRaA/Wc3VK PVksdlN5fXAohOMqy+0v6HpB4+6I65KVy647GtE0/mS8wIFCvRT2VLDHaY+GrpAWvlfy j8si3P41lnwkauh6bDPMN80g1BSQ/F9uInXDyd8f9VV1ODIJwEajLoDECIuHT7LbGxV8 IT9A== 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=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=Vn0gWPwvULzbDipOo4BKrb7X/pGa6i+PWkukETvNknwY0hG3QoLvq6TpptwCl+wKMV Ful56XYGOESSxAIxcgvWeUf/uIQpclkHV2E5Z7LMihMfqGTDw9lvcfawu082ZGTmYays 7Rsg/XdpLdhiBUlsxkKIdMLMXImPMxUHiDo/uI/jbtUnx0tpx9eARNu+FzQXtDzmEqWx Rl77RdAMpktyaREeemQA6AbTZq9luj9yCvp/7W4yugLd3vBaQnx3HJ1FhNglF9MLzJi2 rq2YOqqOTb29cnShmbihvISM9BYgQnDftwdKzGGNeVvamOEYYVfwKhpWZvjMhJBUqqv7 a3kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=oydBayLJ; 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 ca10-20020a056a00418a00b0052b7233120esi12914496pfb.56.2022.08.01.14.43.17; Mon, 01 Aug 2022 14:43:31 -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=oydBayLJ; 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 S235007AbiHAVY4 (ORCPT + 99 others); Mon, 1 Aug 2022 17:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235085AbiHAVYU (ORCPT ); Mon, 1 Aug 2022 17:24:20 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95C1143E78 for ; Mon, 1 Aug 2022 14:23:46 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id ay36-20020a05600c1e2400b003a4e30d7995so14563wmb.5 for ; Mon, 01 Aug 2022 14:23:46 -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=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=oydBayLJLOdfVez5PzNR5ZpWIibjGHyPoAK0Vv+n04M67YVjbG8CpMlZub1u/Pnrk2 WgGSaFaxLohalC14/V8dBWo/FkQpQHg+QLhsWOoq322ZIZj0EkrF5HUsxUx44ibOHdQo qHRBLwu1DVf18KGQLZc0yWUFEXEHXkiWGuD34NVToeyZvVivuvm8s132NLidGXOyb/7v 9njGRegIYiloecDVNy9uu6WNKxwdNC8ibOSEoCNIGJQrKVpaqMRzYJuhbWYAcvk0r6h5 jNGW51mU7cDzzaYaH2UDywTFbn0/yxmNtg8gV2NIgdncoEghI1yGvXbyaa/uy8ogOp4a w73w== 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=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=KvudvJF6XCwlLiU0FAho/L/pOt3ZeBTCM7Q/sSc35aPR4A5bGOUUFQF3VWr2XNZSdY R8RZymYchoC0kZ5KyuL1usb6O9uDZZSxAjetYFET83kgvOk/+bDmjOqUZwnokZaq9ylx 6TryfYN0nyxI2HQrXPo2SgWOHhSigB0NoCgW6v8Lp6FDY5qjd2ZSbWVQKqIgwqOcbrCS d6rk6vV2rOh5BBZycGHYyH6TBHWhnUJwgI82UpWLPIVWD5M+eCBT0Sv1rEPxXclUX+l+ ioRpr/HDD/FlYISIwL5Xb9CQ1iK3pU/rUGzZl1TTfFCb+4v3LfuTSkZOIW6X7QBPf6p5 mLPA== X-Gm-Message-State: AJIora9dpmAaqn3f+yqzlLTr8v29m2eS/554LMhFtr309gW+8Lzm6rpO JpyOfuudhYgwSCEu4VrmnAxYyQ== X-Received: by 2002:a05:600c:1c19:b0:3a3:181e:89e with SMTP id j25-20020a05600c1c1900b003a3181e089emr12260466wms.203.1659389020197; Mon, 01 Aug 2022 14:23:40 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:d00:ceb8:9c09:1302]) by smtp.gmail.com with ESMTPSA id c7-20020adffb07000000b0021e501519d3sm12995285wrr.67.2022.08.01.14.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 14:23:39 -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, Amit Kucheria Subject: [PATCH v4 14/32] thermal/drivers/armada: Switch to new of API Date: Mon, 1 Aug 2022 23:22:26 +0200 Message-Id: <20220801212244.1124867-15-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220801212244.1124867-1-daniel.lezcano@linexp.org> References: <20220801212244.1124867-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=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 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 --- drivers/thermal/armada_thermal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index c2ebfb5be4b3..52d63b3997fe 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -420,9 +420,9 @@ static struct thermal_zone_device_ops legacy_ops = { .get_temp = armada_get_temp_legacy, }; -static int armada_get_temp(void *_sensor, int *temp) +static int armada_get_temp(struct thermal_zone_device *tz, int *temp) { - struct armada_thermal_sensor *sensor = _sensor; + struct armada_thermal_sensor *sensor = tz->devdata; struct armada_thermal_priv *priv = sensor->priv; int ret; @@ -450,7 +450,7 @@ static int armada_get_temp(void *_sensor, int *temp) return ret; } -static const struct thermal_zone_of_device_ops of_ops = { +static const struct thermal_zone_device_ops of_ops = { .get_temp = armada_get_temp, }; @@ -928,9 +928,9 @@ static int armada_thermal_probe(struct platform_device *pdev) /* Register the sensor */ sensor->priv = priv; sensor->id = sensor_id; - tz = devm_thermal_zone_of_sensor_register(&pdev->dev, - sensor->id, sensor, - &of_ops); + tz = devm_thermal_of_zone_register(&pdev->dev, + sensor->id, sensor, + &of_ops); if (IS_ERR(tz)) { dev_info(&pdev->dev, "Thermal sensor %d unavailable\n", sensor_id); -- 2.25.1