Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp23489imn; Wed, 27 Jul 2022 14:05:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sy8xqKAS9KEQCf6HGnV6HVPQNiv9pHQPMIQKjING6HCjADwQAxzJ8N++CPsZI+Aj9didCl X-Received: by 2002:a17:906:7951:b0:72f:c504:49a with SMTP id l17-20020a170906795100b0072fc504049amr18242428ejo.398.1658955943605; Wed, 27 Jul 2022 14:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658955943; cv=none; d=google.com; s=arc-20160816; b=lwU2EA9UZOpPTqzBmhbFHuY7y6rfBAEJ56FGi98lZBfP6hC/nPBz/U1QVKbJl22Md4 p9rkERUEhTFuJIvmURtQWfULIuUt6cfZGdUQqw3Tu++F0Te5qArxCWtxrWz0FKTDqh6p Geu99bjod1jpfWP1VfrdWwBpDXjhyU8mdR59bhnMWVCk/aoUAekpx196nMP92yn/XTU7 GMqkZ4kT/P6X+tG83NYhGbdM98SOcmCIolcZ9SKsp1V4nTIm8RpB9/6K+CoUIQMEz6iw 8P8TaXXngcNtBtdKbvChFDwj5Dz6SlvDBuOAsP0OcB5xJGNFtRRpZ5XMP6tRKN3kmWnI 4BFQ== 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=0qNXTGFtlOgyRJms2wUe/LQRkw+99ki5ct4br/6n4uE=; b=FTP4elNUbxUeG+ZaOoNYpiTstZHAqyiF9ffdqBjQ3WlVW4q0KV9ut7AP/I9xkCItON +wPJK4B4Pya7R20fSK3jR3OoeJH5f2ObSebBgCXIRK8EPr1E28iAb+UtXhHtqOnNEvHc TTMm1Q/pOMftw0abYh2jAkFHqH0oKMi9MZFdLb+MLXXkr+kK4AhJlu5O0h5ptstpwwAs DAoHC0TTbu0QWgS7FTvoNIG2+cJf1pzxoTV+VCg5LvMxVNxsR9KnspsHo+7IStdg/Y7l k9qhEwF6TizMb/l+JFzls/7i4i4b4X+KS56sGrQghBMl/mlE8HcE9xIhn8u3veAlb4hV YI+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=QPHAvvQk; 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 gb32-20020a170907962000b0072e56bd2bbbsi7819445ejc.570.2022.07.27.14.05.10; Wed, 27 Jul 2022 14:05:43 -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=QPHAvvQk; 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 S234845AbiG0VDf (ORCPT + 99 others); Wed, 27 Jul 2022 17:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234152AbiG0VDT (ORCPT ); Wed, 27 Jul 2022 17:03:19 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EDE156B80 for ; Wed, 27 Jul 2022 14:03:18 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id i8so3127753wro.11 for ; Wed, 27 Jul 2022 14:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0qNXTGFtlOgyRJms2wUe/LQRkw+99ki5ct4br/6n4uE=; b=QPHAvvQkj70Y803XO/PVmLOMcqwmSt5eOVTiGxW2Qx92bhC5Cph0f5iuO3Z6NUdnBl HrayMHWWgdq6NDxPwLIkgAN5g0Fuj0BAFFevscZ3priNoJMtSzHLpt0zpRrUB6NY6F2E IAWrrL89tl1w8JNQADd1CHG8sY+r92EVszvnuiUCxO77ctb2bdS7w3YGK0Vt8EZh7kQI idVkJO8bZMNX25FwECOR1cE+/1UWl19L3ZXVlhFGe46nAIqGhx+/fL4m/qEpWS8Pfff4 APBruzthgSN+cVpzRUZLSdIDIpk9qXXuMQwJCTCsYn5OsBoazXC1AemMB9a3Tfc/UK9F q92w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0qNXTGFtlOgyRJms2wUe/LQRkw+99ki5ct4br/6n4uE=; b=5xBb95ZR4QyZEgbcduiW77lg5tWyDXXaThd9r7OrlnVOeivuk/mEMM/gfS20dOltuw XFRze7qh9OY0n9bctz0L0i3awIw/r0uKRcFycZXQf9yU1KjK+ymny72vm3eeqjpXQTlJ 6RVBmjA9SBXrjKJ5V07l2rBxlQfWPWqtGikVUB102IKi7JLA12R5Rg24X27kf9+3AaEZ RBymxtHCCzVQJlSgzpc4PmADdxrCsUPrdlFCwElRjGy/oblxD5RzlDYY7yoaEfDUwRSr 7uAs86P2ABeHKeXQIaYhK3Aw/aLtcLoGDE5mFA6twzsOFzdFLbZS8qyQA9h1o277ybSl yf9A== X-Gm-Message-State: AJIora+NjuoOOCBW0uguUhUhRDWYuOxamum8WdgAf4aJ2Wp82OvdsjTz n/Duk0P2lZY4pgYLeMYNoHyZRA== X-Received: by 2002:adf:f90c:0:b0:21e:5293:4390 with SMTP id b12-20020adff90c000000b0021e52934390mr15255954wrr.167.1658955797002; Wed, 27 Jul 2022 14:03:17 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:65a8:ebd8:4098:d9d0]) by smtp.gmail.com with ESMTPSA id h6-20020a05600c350600b003a38606385esm37908wmq.3.2022.07.27.14.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 14:03:16 -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 v3 06/32] thermal/drivers/mmio: Switch to new of API Date: Wed, 27 Jul 2022 23:02:27 +0200 Message-Id: <20220727210253.3794069-7-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220727210253.3794069-1-daniel.lezcano@linexp.org> References: <20220727210253.3794069-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 --- drivers/thermal/thermal_mmio.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/thermal_mmio.c b/drivers/thermal/thermal_mmio.c index 360b0dfdc3b0..1bf1a16533da 100644 --- a/drivers/thermal/thermal_mmio.c +++ b/drivers/thermal/thermal_mmio.c @@ -20,11 +20,10 @@ static u32 thermal_mmio_readb(void __iomem *mmio_base) return readb(mmio_base); } -static int thermal_mmio_get_temperature(void *private, int *temp) +static int thermal_mmio_get_temperature(struct thermal_zone_device *tz, int *temp) { int t; - struct thermal_mmio *sensor = - (struct thermal_mmio *)private; + struct thermal_mmio *sensor = tz->devdata; t = sensor->read_mmio(sensor->mmio_base) & sensor->mask; t *= sensor->factor; @@ -34,7 +33,7 @@ static int thermal_mmio_get_temperature(void *private, int *temp) return 0; } -static const struct thermal_zone_of_device_ops thermal_mmio_ops = { +static const struct thermal_zone_device_ops thermal_mmio_ops = { .get_temp = thermal_mmio_get_temperature, }; @@ -68,10 +67,10 @@ static int thermal_mmio_probe(struct platform_device *pdev) } } - thermal_zone = devm_thermal_zone_of_sensor_register(&pdev->dev, - 0, - sensor, - &thermal_mmio_ops); + thermal_zone = devm_thermal_of_zone_register(&pdev->dev, + 0, + sensor, + &thermal_mmio_ops); if (IS_ERR(thermal_zone)) { dev_err(&pdev->dev, "failed to register sensor (%ld)\n", @@ -79,7 +78,7 @@ static int thermal_mmio_probe(struct platform_device *pdev) return PTR_ERR(thermal_zone); } - thermal_mmio_get_temperature(sensor, &temperature); + thermal_mmio_get_temperature(thermal_zone, &temperature); dev_info(&pdev->dev, "thermal mmio sensor %s registered, current temperature: %d\n", pdev->name, temperature); -- 2.25.1