[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230220132325.ksmho3p54zr2hm4a@mercury.elektranox.org>
Date: Mon, 20 Feb 2023 14:23:25 +0100
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: rafael@...nel.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, Zhang Rui <rui.zhang@...el.com>,
Len Brown <lenb@...nel.org>,
Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Raju Rangoju <rajur@...lsio.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Ido Schimmel <idosch@...dia.com>,
Petr Machata <petrm@...dia.com>,
Gregory Greenman <gregory.greenman@...el.com>,
Kalle Valo <kvalo@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Amit Kucheria <amitk@...nel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Markus Mayer <mmayer@...adcom.com>,
Support Opensource <support.opensource@...semi.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Thara Gopinath <thara.gopinath@...il.com>,
Niklas Söderlund <niklas.soderlund@...natech.se>,
Heiko Stuebner <heiko@...ech.de>,
Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Alim Akhtar <alim.akhtar@...sung.com>,
Orson Zhai <orsonzhai@...il.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Chunyan Zhang <zhang.lyra@...il.com>,
Vasily Khoruzhick <anarsoul@...il.com>,
Yangtao Li <tiny.windzz@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Talel Shenhar <talel@...zon.com>,
Eduardo Valentin <edubezval@...il.com>,
Keerthy <j-keerthy@...com>,
Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Stefan Wahren <stefan.wahren@...e.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
ye xingchen <ye.xingchen@....com.cn>,
Zheng Yongjun <zhengyongjun3@...wei.com>,
Tim Zimmermann <tim@...ux4.de>,
Yang Li <yang.lee@...ux.alibaba.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
Jiang Jian <jiangjian@...rlc.com>,
Daniel Golle <daniel@...rotopia.org>,
Balsam CHIHI <bchihi@...libre.com>,
Randy Dunlap <rdunlap@...radead.org>,
Mikko Perttunen <mperttunen@...dia.com>,
"open list:ACPI THERMAL DRIVER" <linux-acpi@...r.kernel.org>,
"open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)"
<linux-ide@...r.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
"open list:HARDWARE MONITORING" <linux-hwmon@...r.kernel.org>,
"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@...r.kernel.org>,
"open list:ARM/Allwinner sunXi SoC support"
<linux-sunxi@...ts.linux.dev>,
"open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..."
<linux-input@...r.kernel.org>,
"open list:CXGB4 ETHERNET DRIVER (CXGB4)" <netdev@...r.kernel.org>,
"open list:INTEL WIRELESS WIFI LINK (iwlwifi)"
<linux-wireless@...r.kernel.org>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@...ts.infradead.org>,
"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@...r.kernel.org>,
"open list:RENESAS R-CAR THERMAL DRIVERS"
<linux-renesas-soc@...r.kernel.org>,
"open list:ARM/Rockchip SoC support"
<linux-rockchip@...ts.infradead.org>,
"open list:SAMSUNG THERMAL DRIVER"
<linux-samsung-soc@...r.kernel.org>,
"open list:TEGRA ARCHITECTURE SUPPORT" <linux-tegra@...r.kernel.org>,
"open list:TI BANDGAP AND THERMAL DRIVER"
<linux-omap@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v1 01/17] thermal/core: Add a thermal zone 'devdata'
accessor
Hi,
On Sun, Feb 19, 2023 at 03:36:41PM +0100, Daniel Lezcano wrote:
> The thermal zone device structure is exposed to the different drivers
> and obviously they access the internals while that should be
> restricted to the core thermal code.
>
> In order to self-encapsulate the thermal core code, we need to prevent
> the drivers accessing directly the thermal zone structure and provide
> accessor functions to deal with.
>
> Provide an accessor to the 'devdata' structure and make use of it in
> the different drivers.
>
> No functional changes intended.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
> ---
...
> drivers/power/supply/power_supply_core.c | 2 +-
...
> diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
> index 7c790c41e2fe..166f0aacc797 100644
> --- a/drivers/power/supply/power_supply_core.c
> +++ b/drivers/power/supply/power_supply_core.c
> @@ -1142,7 +1142,7 @@ static int power_supply_read_temp(struct thermal_zone_device *tzd,
> int ret;
>
> WARN_ON(tzd == NULL);
> - psy = tzd->devdata;
> + psy = thermal_zone_device_get_data(tzd);
> ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_TEMP, &val);
> if (ret)
> return ret;
Acked-by: Sebastian Reichel <sebastian.reichel@...labora.com>
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists