Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2751086imw; Sun, 10 Jul 2022 14:27:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vdCYR7DNWOoNaUyvX8TxRv7EZ6GOGRV3TDmNEu5IKkuu36O6NLSQleNk6bDSj53W5HDdo3 X-Received: by 2002:a17:907:3da0:b0:72b:47df:c1d7 with SMTP id he32-20020a1709073da000b0072b47dfc1d7mr5155938ejc.214.1657488426150; Sun, 10 Jul 2022 14:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657488426; cv=none; d=google.com; s=arc-20160816; b=KMJDuxLtS+b7muNrr9s/FoW6RLpgyZuOkEd/ssbKR2rc6HOAplUGQ30im59m5SZjS6 9HtdO02YzNybBLF6xLFa/9DcvYlfa2CvPrj8ZnrCfsTVFshBFxZ1nPg3lW83ZSpwTjBI WuYCEmr/uuNEodWDT+EQqt4kHE2ZubMrbZ2YjKF1zRab1/ISyow+HxLHOdsMXdeUCj+L 0uPDDYMFR0ERsIZHczUOnZ/X8alwP7pzFw/omora8HOeewGSaz/fwQqeUYQVo7f6mugR YAKL6L81TqaI1D3czXdVaK5dAjmYCsrA+UpU7HFzuvSAb6MRKSvGF3tNS87P38ZysjDP xwkw== 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=Xk6A/pNWCl/Nzs7Qg1vyN7A/ewbkmH3NrwD0SYWTSzQ=; b=cDzhWUqqYrFxV9hHwdVc02Or5CHt50rrnD8vI7TRB2fi+kFlvq2vaPgsWpgNa2+hEI jo00XmSsTfN1eRiu3Gr8xR7WoJTEpx5MQFF0I6nF2Cb6+FoT0LsW5aaK65iFcrIqzpf5 shkLfLbXEtdpog4SubWAUe1XrF9aEjZSGbuhHc296UgCux70ZMVSg98vNCdvCzpF7etw xOkRI2CWG/P4rmcfyWiAdJXDWlRtF9UgHWTLHysrHT/rSqddisomluMsXjT5WcbOh96+ xh0oa/10cIzPzpiH2qs+0xINlvYUwyqf42E5v9zQxdqDFAau2bK/S31+FcpfX3WgjRGU 2FQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=bY0fExwP; 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 ds19-20020a170907725300b0072b29827476si7816037ejc.287.2022.07.10.14.26.42; Sun, 10 Jul 2022 14:27:06 -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=bY0fExwP; 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 S229657AbiGJVZA (ORCPT + 99 others); Sun, 10 Jul 2022 17:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiGJVYq (ORCPT ); Sun, 10 Jul 2022 17:24:46 -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 B871311152 for ; Sun, 10 Jul 2022 14:24:43 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id bk26so4740164wrb.11 for ; Sun, 10 Jul 2022 14:24:43 -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=Xk6A/pNWCl/Nzs7Qg1vyN7A/ewbkmH3NrwD0SYWTSzQ=; b=bY0fExwP3MURnYRBx4omWr6dHDeloNf3GtuXmB5SJTGKaGli9DPxOPVtnSXfYy/IZj euH+0zIKdnC7syngU7AO3tFLPLy4YJ7YE3aSQJW879SKowor/hPmNwimCZyTBGh5Fokw pN9r62L2aLDdSE5mQlVIK31j3WZHW3y+JADNgy7szDmqsrXMtZDNu9XGKvArcYSW2SHK ZHv1RnXiGJEiqlVDqMmrkZgXzjw4/kKAAaHxZEN+0umle7/d+QLJLXzJVYqYnmYmZfa0 KetYEco7njc8yITUk7gDVNEXgnqAMDxUMyamEjaaT7qUP84VbJM1RZM3jkM/Ssdx3lA0 VlZg== 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=Xk6A/pNWCl/Nzs7Qg1vyN7A/ewbkmH3NrwD0SYWTSzQ=; b=OYDeE28S3FXg1ImpozTov0CUseU+XPfgws2OGt/x9vWibgY5097YDmOMn1ncoqB5NZ +M32NzMSxjHuwpkNgLYJlVVd7CoWVvMFULo/o3o6YrwFDX/EJSZGy0BTIleAst+1AIBU KrEtf6YZUoT1J15R+qedkG7ULA6LdhTm9SMtJAToSq2+v6q2mdtfs1+V1Ozh8pc5/7RJ XLi9tGt4HCtwwuC5On7IFxWd6tGVDejsByND3pO8V16fY1jR9I3hg+6AWeR3CmkotE3T ahjPJEvQJwBsZ7SXYAuPjWBMJugt0dA6BwQEVRJmAaL3BMAzqbdk4cb7feGSRIBFX9En JsWA== X-Gm-Message-State: AJIora/snw9sNkmOkovoh3znIODBOcIk9iiE98PHk3rPJv/o10sM8kw4 bD8EA1p9gTP4EnGq0IVg0vo9Vw== X-Received: by 2002:a05:6000:1446:b0:21d:27ea:5a01 with SMTP id v6-20020a056000144600b0021d27ea5a01mr13953400wrx.314.1657488282307; Sun, 10 Jul 2022 14:24:42 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:c7c0:6823:f3ce:2447]) by smtp.gmail.com with ESMTPSA id m19-20020a05600c3b1300b003a2dd0d21f0sm7142759wms.13.2022.07.10.14.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 14:24:42 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, khilman@baylibre.com, abailon@baylibre.com, amitk@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Talel Shenhar Subject: [PATCH v1 06/33] thermal/drivers/mmio: Switch to new of API Date: Sun, 10 Jul 2022 23:23:56 +0200 Message-Id: <20220710212423.681301-7-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710212423.681301-1-daniel.lezcano@linexp.org> References: <20220710212423.681301-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, T_SCC_BODY_TEXT_LINE 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. Use this new API. 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..fecf537bb470 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 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