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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 926F0C61DA4 for ; Sun, 19 Feb 2023 15:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230406AbjBSPHb (ORCPT ); Sun, 19 Feb 2023 10:07:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230369AbjBSPH1 (ORCPT ); Sun, 19 Feb 2023 10:07:27 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82CC1027C for ; Sun, 19 Feb 2023 07:07:23 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id by30so677255ljb.10 for ; Sun, 19 Feb 2023 07:07:23 -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=vfvHBPjFD3fnJEXsEdcPBmeh9w1ZDPtCXMtTzNwUMP4=; b=2MT453GERnVCOXc+pZDXjhNske3WayAQFfKvKJjkTaSXaH9ypTF1xoFmHts7lcs6Tu 8awMK4Po/ABZ5dh9w4kEV1FldjJxMrBZVoiOQuoO90QinuTnKOP01zHiWmaOtrj+nQvd F+ZaO4uYXLhJM+VztPHntmkaf7c2ZT1Q0aPQ00s5xppJj7swa9G6CIbKQNlCxZ/w13pb K749pLo5Tg+B9AZJIM2QgMhbSb1PATOb59v0crPXiX4ae6edrBvt+0E1yX/NUh/mJvXP jtQvKiAA2OdtGon53LBFrgDiJMJWAudwD546mUhHoHUTb6TiVX8ddk95TiBrWGbr05LD zGSQ== 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=vfvHBPjFD3fnJEXsEdcPBmeh9w1ZDPtCXMtTzNwUMP4=; b=dWc2ICj7vH5KQz175ZTfLEZoVjDxFZxcFgdZJ5T7I6n3LO9CKUe7pSsJaz9RwUTEzM 5NdZJ07o/qWLZNkBCA7Rh6+a2qT6tmiIW10jWIfbVPi+FXCC4qvG1L4+td8M+4+LejHb q8T7BKK+klRg31q0rCFlDOb+Qv6+BdNKUoJGGRTnQhm771vH1CvgpjrxX2XgNMgFS3xR wNSAkqXMLE9kk2dAuPvj7sdlgCO7yD6iHn2gFVAax2tBR7AYBepMa7YyCG5epoSfuNWa KFMGyTu+BZBcb8be/lkc4+z6TVWoNn3CfQtw58daPj1+brt3h4T9FBH458rOhgbblnZe VmaQ== X-Gm-Message-State: AO0yUKWNwcXSMf6Zyz0ZuDhpKX8qLbNczkOmW62pBYWUGSnR/1kd2ECT 3c54KFi3JOxZaeztx8BpeaCSWQ== X-Google-Smtp-Source: AK7set9/3IywPw1ycXkXfjTE1BOHzIfMRekgiKErVRCZRj2jjMurZbyZpbHyyTOgbRvkntf1piSbOg== X-Received: by 2002:a05:651c:1541:b0:293:14c8:f588 with SMTP id y1-20020a05651c154100b0029314c8f588mr403194ljp.27.1676819242130; Sun, 19 Feb 2023 07:07:22 -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 f23-20020a2e9517000000b0029355185926sm1245807ljh.137.2023.02.19.07.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 07:07:21 -0800 (PST) Date: Sun, 19 Feb 2023 16:07:20 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230219143657.241542-2-daniel.lezcano@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, > struct thermal_cooling_device *, -- Kind Regards, Niklas Söderlund