Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3102810imw; Mon, 11 Jul 2022 01:42:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vaImG8cG67IUw0MOeVNXTAOpBypHlGnxGPT43g0nCCIxGpuHc/dqRi0vRNqIgOcErc0Q/x X-Received: by 2002:a62:1508:0:b0:528:be70:2f69 with SMTP id 8-20020a621508000000b00528be702f69mr17339785pfv.42.1657528962760; Mon, 11 Jul 2022 01:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657528962; cv=none; d=google.com; s=arc-20160816; b=aWRKSCivFSw7w0C9T2pQfPqv8vc9nltE2TUy+diWNcL6zhz7QwjcKB7Et+iFWWg0U6 4JGaCH5uMgOzj2fCp9JxDc9HlZ1WYXDvraz9y+eAwDl4NO8vkU8Pk7lQ1YQfSsioxedN Rc7PDHxJIjbunzp1BdJZAI23kCKxV2DNPzilNhUpcwqzgfagoT/Q4wQIC0yOCj11eQzX /vVdcV6SFU5U0JXQugcn57CVj6YBkmas/+tV4MQIzNqWzw4oQiW2A/iRJzFZMBW5Gee/ dEsTDcN/vPjMge1xyBiVmOSLeU6qbk67CuuCkn9CDBJWi7XPkRpuj+jn2v18ou9mTihd SffA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7zyLGVcEIyQkC+gl1zpwEzMAKU5QvqQXdssCJTKoXVE=; b=TNM+7+iXRNB+ey6N4pTRSCxKnwePDOidnWMVm1CHYpbAKYSB4c+XqhJR31NRnCKi2m O6KByD3uIPmUuiDXjyvdmQFTlZnvLDgO+vlmNanOXy3pzd/i/mMJjBCveFoPBaNdwXkd EfFyKN+zo5QI1BXjTDBkBSpJZ8j49JoEjT+oZv8ldcS7BCZM3pNPVDEXZgjDYkuMJ6tm JX6vIgW07/Al04z9O2PxTnO+q6LWzceXKTLcuXTMrohsrs5rsQXEm80RwYPBz6Ld18AE qsSuoQeWL+4DekVwVQVgCIvcbwNjn7PZEOjdn6Y3Ayo2z0d/4/7nxYUoqHd6cXNvBxVK z7qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metafoo.de header.s=default2002 header.b=WL1SOL69; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 23-20020a630217000000b003fa2f024afcsi9414025pgc.433.2022.07.11.01.42.31; Mon, 11 Jul 2022 01:42:42 -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=@metafoo.de header.s=default2002 header.b=WL1SOL69; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbiGKHwX (ORCPT + 99 others); Mon, 11 Jul 2022 03:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiGKHwW (ORCPT ); Mon, 11 Jul 2022 03:52:22 -0400 Received: from www381.your-server.de (www381.your-server.de [78.46.137.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C1C1C922; Mon, 11 Jul 2022 00:52:20 -0700 (PDT) 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> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.6/26597/Sun Jul 10 09:56:43 2022) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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.