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 DE4FEC05027 for ; Sun, 19 Feb 2023 18:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ofJSqx7zRI6EorpfBbQAKk970rJXU8Lshyo67tpjsLQ=; b=XYPHU4UOCy5weHX3jsMwddOmgm nSt6SAmjMY+ZlAn+bh5pNXBleL94je8iGKtYox+1Fync1doGbFz6hyT4g5JkTZaSINMcxU66iFU1H uMGC1jpvRSKVwLJg+OGgG2JctcNuArwT+nyg+mXDXu6u7lOEOXRHopqTHr+EWfsHs4ibm10mRUV61 Ww064OlGGMkrCFw01TuDtOUEZYhEkbOA2FVw3R5QrtIsQnoom34fkJSpAu5WbEivUI531F1VPSaUi jnyZUgaIY+NJcI9q33AdtxvDtSGeJFQkZpOgdbRW+LYEhSQFMJHgf4m8ipscaq0J9bAWDiq/u5cYj TXVIcaKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pToLZ-0026Zl-HG; Sun, 19 Feb 2023 18:23:37 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pToLU-0026X5-Vt for linux-mediatek@lists.infradead.org; Sun, 19 Feb 2023 18:23:35 +0000 Received: by mail-lf1-x132.google.com with SMTP id x27so1424373lfu.4 for ; Sun, 19 Feb 2023 10:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ofJSqx7zRI6EorpfBbQAKk970rJXU8Lshyo67tpjsLQ=; b=xeLeOsLmY3pe81rt3ga3i6n8lIyX45qvBgDtiyY75SxtAK1EKPLEQqXyq1T1gn61Wl SJ+jJyXEslG9XZjq5SVgthjWH+AkiKzov8phzcdx8q8u1wRZD2dSS62mDgcNoDTrJRRD BGXSBGZw4wh0B5bjOFtjGs/lNfSujOK7nRSeBI4eM8qRDyPK0u0ttERgJvfd64NhAQOL +GauQSBtxQusXIDfvDLOsegFBY0WgTEt2z+DzKpl1W3Bv4DRhTSQjKczNAPttxdfVqBM dTEYKt9a7qM1Hh42++i5n3Yf5pFVYUGxLDKZ4ol99hiPHSnPg3ZKrbHR9P3kkfouE6yn kpWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ofJSqx7zRI6EorpfBbQAKk970rJXU8Lshyo67tpjsLQ=; b=MQhLfdvmXo8kkPq9yb8LlHDk/zZn9KucFFwR50Y1y7RdB7Eu8SagXiA1L0NWjvAzL0 myx4OSialv6hIDM6vKXUuJmCPxkF3mpg/uECuF/ZBMbDR6N1Ijrm2i+HM/798VngPKPJ 3yEUOnHKnxIlvy+LQfGdp50RqKnk2SxRly7W9pcDF3r0ACDyRnKPenZqwwSnC3Ts8i/s zqdYuYsGmMSF3iWtg4d8aVheBXmV2HIpAPVIxZG2sQNY1S1ecvw/OxBXtenzqGRfnxKl rXd8ibA+y/K23yIxk8lj7MGPqNHmRRCUu+xEj8t7OfJMR4pKyYRDNJpPWx1MdxHXObas NF2w== X-Gm-Message-State: AO0yUKUtm4x7DP1e06U9yqPF0lrkycWt8Pr47dsl1wjdVyFdbgNFsL2s nT/GLWkvvM6VEdLYqoT2DtBdog== X-Google-Smtp-Source: AK7set+YZZSclvxF42ryv90+XULHABPVIVIEdoKcZJbE3Ao4Z3FCGIUuBB+mT3TOxDnV55f/X2PI5w== X-Received: by 2002:ac2:4c21:0:b0:4dc:4c1d:eec1 with SMTP id u1-20020ac24c21000000b004dc4c1deec1mr483829lfq.46.1676831003077; Sun, 19 Feb 2023 10:23:23 -0800 (PST) Received: from localhost (h-46-59-89-207.A463.priv.bahnhof.se. [46.59.89.207]) by smtp.gmail.com with ESMTPSA id b26-20020ac2563a000000b004db51852e6csm56694lff.246.2023.02.19.10.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 10:23:22 -0800 (PST) Date: Sun, 19 Feb 2023 19:23:21 +0100 From: Niklas =?utf-8?Q?S=C3=B6derlund?= To: Daniel Lezcano Cc: rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Rui , Len Brown , Damien Le Moal , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Jean Delvare , Guenter Roeck , Jonathan Cameron , Lars-Peter Clausen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Dmitry Torokhov , Raju Rangoju , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ido Schimmel , Petr Machata , Gregory Greenman , Kalle Valo , Sebastian Reichel , Liam Girdwood , Mark Brown , Miquel Raynal , Amit Kucheria , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Markus Mayer , Support Opensource , Andy Gross , Bjorn Andersson , Konrad Dybcio , Thara Gopinath , Heiko Stuebner , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , Orson Zhai , Baolin Wang , Chunyan Zhang , Vasily Khoruzhick , Yangtao Li , Thierry Reding , Jonathan Hunter , Talel Shenhar , Eduardo Valentin , Keerthy , Kunihiko Hayashi , Masami Hiramatsu , Matthias Brugger , AngeloGioacchino Del Regno , Stefan Wahren , Neil Armstrong , ye xingchen , Zheng Yongjun , Tim Zimmermann , Yang Li , Srinivas Pandruvada , Ricardo Neri , Jiang Jian , Daniel Golle , Balsam CHIHI , Randy Dunlap , Mikko Perttunen , "open list:ACPI THERMAL DRIVER" , "open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "open list:HARDWARE MONITORING" , "open list:IIO SUBSYSTEM AND DRIVERS" , "open list:ARM/Allwinner sunXi SoC support" , "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." , "open list:CXGB4 ETHERNET DRIVER (CXGB4)" , "open list:INTEL WIRELESS WIFI LINK (iwlwifi)" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "open list:ARM/QUALCOMM SUPPORT" , "open list:RENESAS R-CAR THERMAL DRIVERS" , "open list:ARM/Rockchip SoC support" , "open list:SAMSUNG THERMAL DRIVER" , "open list:TEGRA ARCHITECTURE SUPPORT" , "open list:TI BANDGAP AND THERMAL DRIVER" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH v1 01/17] thermal/core: Add a thermal zone 'devdata' accessor Message-ID: References: <20230219143657.241542-1-daniel.lezcano@linaro.org> <20230219143657.241542-2-daniel.lezcano@linaro.org> <4d8f1e68-8d2c-b70f-69c7-a1137ac4b05f@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4d8f1e68-8d2c-b70f-69c7-a1137ac4b05f@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230219_102333_304387_3F891873 X-CRM114-Status: GOOD ( 30.23 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 2023-02-19 18:07:36 +0100, Daniel Lezcano wrote: > On 19/02/2023 16:07, Niklas Söderlund wrote: > > Hi Daniel, > > > > Thanks for your work. > > > > On 2023-02-19 15:36:41 +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 > > > --- > > > > ... > > > > > drivers/thermal/rcar_gen3_thermal.c | 4 ++-- > > > drivers/thermal/rcar_thermal.c | 3 +-- > > > > For R-Car, > > > > Reviewed-by: Niklas Söderlund > > > > ... > > > > > > > diff --git a/include/linux/thermal.h b/include/linux/thermal.h > > > index 2bb4bf33f4f3..724b95662da9 100644 > > > --- a/include/linux/thermal.h > > > +++ b/include/linux/thermal.h > > > @@ -365,6 +365,8 @@ thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int > > > void *, struct thermal_zone_device_ops *, > > > struct thermal_zone_params *, int, int); > > > +void *thermal_zone_device_get_data(struct thermal_zone_device *tzd); > > > + > > > > bikeshedding: > > > > Would it make sens to name this thermal_zone_device_get_priv_data(), > > thermal_zone_device_get_priv() or something like that? To make it more > > explicitly when reading the driver code this fetches the drivers private > > data, and not some data belonging to the zone itself. > > In the headers files, there are more occurrences with _name_priv(): > > # _name_priv() > git grep priv include/linux/ | grep "priv(" | grep -v get | wc -l > 52 > > # _name_private() > git grep priv include/linux/ | grep "private(" | grep -v get | wc -l > 33 > > # _name_get_private() > git grep priv include/linux/ | grep "private(" | grep get | wc -l > 12 > > # _name_get_priv() > git grep priv include/linux/ | grep "priv(" | grep get | wc -l > 4 > > > What about thermal_zone_device_priv() ? Looks good to me. > > > > > > > -- > Linaro.org │ Open source software for ARM SoCs > > Follow Linaro: Facebook | > Twitter | > Blog > -- Kind Regards, Niklas Söderlund