From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F535C433EF for ; Mon, 11 Jul 2022 07:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ORjPUznOyoJJ4u87NdMtDpMZVnAxs5tbV4vRHfzK28s=; b=ZwVP3W9+gCRTXr Os/K4pVtCM0DIIhzJCQl7+FeHcyHK7jdBq7MpIqtDwLlSOPompAvagKOCwjCqRzlUa6a1S5nVLKEx 8cU/e9AZJHYu/PO1lqk203O542JiSc4gFwIEQs7szLL2wO9qlI1Xi3xqRFgDCU/cYEEk9q/cJfzkl P/n2BP10Bq0LGJcUizUGpwJuGU+Zw5hTmAiJ3Kau5a8SzQrTs9YqZbzyUv+yRqpxzTlJSvA3zbL7E 0y7/3J6Lmk/Uasov8/Z5lD1hFoCssSrIFgOlG12L0dBt9EC6jI+BGQyZyXmiyzi+ehBroJU1SP/1v EcRgEXwHEjIfBsLRr1Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAoDk-00GzAM-3S; Mon, 11 Jul 2022 07:52:44 +0000 Received: from www381.your-server.de ([78.46.137.84]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAoDL-00GyrN-90 for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 07:52:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=7zyLGVcEIyQkC+gl1zpwEzMAKU5QvqQXdssCJTKoXVE=; b=WL1SOL694htlJ6V9kixrsLc3+l nkMyBDfR9rX8pFnBzj16yzkxbOI5mDNEA88W49Rrh6H2+wX+1oe4XuFX5PqFpvZcoB05p64TvrQDq LDQKKyhQa060vAMecHWOLaP1r64sTnAp4dL4iyIYKJ/scUwMl6LNarizhLn5+fkMOLvBa+DdPT4qn MIGoJ60RTFIHjRnRvLvl7xgT0ab2CccVoO6Onov7mlznOlUjAyDsE7X5WRdx+35jeu+C7RtF6Cy8M FpSYfp13IEh8x5zctziqSeDc/dl3Y3f8pQKLDMdgMgqAsOpLS6dBgNGAdbPKWVthzOPg/1neSg143 hUewiJbg==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1oAoDA-000Cc6-7p; Mon, 11 Jul 2022 09:52:08 +0200 Received: from [2001:a61:2a49:8301:9e5c:8eff:fe01:8578] by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oAoD9-000551-Rv; Mon, 11 Jul 2022 09:52:07 +0200 Message-ID: <6b81cb4d-4080-188d-df7c-1529e55ddf7f@metafoo.de> Date: Mon, 11 Jul 2022 09:52:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v1 27/33] iio/drivers/sun4i_gpadc: Switch to new of thermal API Content-Language: en-US To: Daniel Lezcano , 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, Jonathan Cameron , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , "open list:IIO SUBSYSTEM AND DRIVERS" , "moderated list:ARM/Allwinner sunXi SoC support" , "open list:ARM/Allwinner sunXi SoC support" References: <20220710212423.681301-1-daniel.lezcano@linexp.org> <20220710212423.681301-28-daniel.lezcano@linexp.org> From: Lars-Peter Clausen In-Reply-To: <20220710212423.681301-28-daniel.lezcano@linexp.org> X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.6/26597/Sun Jul 10 09:56:43 2022) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_005219_356732_D3C8D0B6 X-CRM114-Status: GOOD ( 21.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/10/22 23:24, Daniel Lezcano wrote: > 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/iio/adc/sun4i-gpadc-iio.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c > index 2d393a4dfff6..7aebfd337871 100644 > --- a/drivers/iio/adc/sun4i-gpadc-iio.c > +++ b/drivers/iio/adc/sun4i-gpadc-iio.c > @@ -412,9 +412,9 @@ static int sun4i_gpadc_runtime_resume(struct device *dev) > return 0; > } > > -static int sun4i_gpadc_get_temp(void *data, int *temp) > +static int sun4i_gpadc_get_temp(struct thermal_zone_device *tz, int *temp) > { > - struct sun4i_gpadc_iio *info = data; > + struct sun4i_gpadc_iio *info = tz->devdata; > int val, scale, offset; > > if (sun4i_gpadc_temp_read(info->indio_dev, &val)) > @@ -428,7 +428,7 @@ static int sun4i_gpadc_get_temp(void *data, int *temp) > return 0; > } > > -static const struct thermal_zone_of_device_ops sun4i_ts_tz_ops = { > +static struct thermal_zone_device_ops sun4i_ts_tz_ops = { > .get_temp = &sun4i_gpadc_get_temp, > }; Why is the const removed? If the framework modifies the structure you need a per device copy of the struct. > > @@ -637,9 +637,9 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) > pm_runtime_enable(&pdev->dev); > > if (IS_ENABLED(CONFIG_THERMAL_OF)) { > - info->tzd = thermal_zone_of_sensor_register(info->sensor_device, > - 0, info, > - &sun4i_ts_tz_ops); > + info->tzd = thermal_of_zone_register(info->sensor_device, > + 0, info, > + &sun4i_ts_tz_ops); > /* > * Do not fail driver probing when failing to register in > * thermal because no thermal DT node is found. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel