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 289BFC61DA4 for ; Wed, 22 Feb 2023 09:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231754AbjBVJgI (ORCPT ); Wed, 22 Feb 2023 04:36:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232442AbjBVJf1 (ORCPT ); Wed, 22 Feb 2023 04:35:27 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA9973B3DD; Wed, 22 Feb 2023 01:33:32 -0800 (PST) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id B776866021B5; Wed, 22 Feb 2023 09:31:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1677058321; bh=ypc2TjbNSU7dsJCUFEveVUwkvQ3RanGmsWbkzF7sWgo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FNUVhOeaDNZZVi6pZQ6VK2lEs7a/M+4teR0YM9KUip7qVBhKutdX2Zy5nYfzcsOw/ djyt2EwIP5Di/RZRdmEMzeMePbU80C0D67C7pzmY3I+ERCTLfaiuXS0VslS+F5WaQf fjBUKZFaOPp8MNRri82Y6HG0SawCtkD28MTQdNV3Ngc9lm+Y7QvVyAYXZkPONKGGR3 //lqrmT+fnoduRyAOcor6oP/m+ktaSMj/YwcK6jU0HJ5AVhr5fHJkV6I6p37l2uCTI uK1G4sXntFRI6/e2q9TLw+v7lgGy9Qq0NJ20hPk63AyJ776C9yOMTdEfDrBHBaptWP uWZWkFvCBsZtA== Message-ID: Date: Wed, 22 Feb 2023 10:31:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 05/16] thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs() Content-Language: en-US To: Daniel Lezcano , rafael@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Blumenstingl , Guillaume La Roque , Amit Kucheria , Zhang Rui , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andy Gross , Bjorn Andersson , Konrad Dybcio , Thara Gopinath , Vasily Khoruzhick , Yangtao Li , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Eduardo Valentin , Keerthy , Matthias Brugger , Balsam CHIHI , Daniel Golle , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , ye xingchen , Randy Dunlap , Adam Ward , Neil Armstrong , Mark Brown , "open list:THERMAL DRIVER FOR AMLOGIC SOCS" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "open list:ARM/QUALCOMM SUPPORT" , "open list:ARM/Allwinner sunXi SoC support" , "open list:TEGRA ARCHITECTURE SUPPORT" , "open list:TI BANDGAP AND THERMAL DRIVER" , "moderated list:ARM/Mediatek SoC support" References: <20230221180710.2781027-1-daniel.lezcano@linaro.org> <20230221180710.2781027-6-daniel.lezcano@linaro.org> From: AngeloGioacchino Del Regno In-Reply-To: <20230221180710.2781027-6-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 21/02/23 19:06, Daniel Lezcano ha scritto: > The devres variant of thermal_add_hwmon_sysfs() only takes the thermal > zone structure pointer as parameter. > > Actually, it uses the tz->device to add it in the devres list. > > It is preferable to use the device registering the thermal zone > instead of the thermal zone device itself. That prevents the driver > accessing the thermal zone structure internals and it is from my POV > more correct regarding how devm_ is used. > > Signed-off-by: Daniel Lezcano > Acked-by: Martin Blumenstingl #amlogic_thermal Reviewed-by: AngeloGioacchino Del Regno #MediaTek auxadc