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 9253DC43334 for ; Mon, 11 Jul 2022 10:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z07EerRfY6eftb7E0Y8fZvjk9Pb7cb6cLulrooeM5g8=; b=GETap5qlJoLcPw fwWWsIpXMf3s3zCahd9PPgqpurZnBbcZM1m9T126dGTP4BMOPC3yBDqRwUx5asANxDPkBgBObvMC/ Sve6/HbrOSWJk4DhABofZCKry8RYaHFTnky9/YC6UToHc2yPpHoZJJzb5tB5F1O6QtzELIErVl1Uf QCLMVvOIkL/mdBDBlZplZLmJXp7WdLtACC1pZD4CKDLk2RcLS3s6TlaTuatY3SjLepLd0ypfrSCG8 3NRKbezAGdnLfO659Z/zhb0qPv/9R7TOGDlHB5M+mOKNwgS7G0b0l8nA/+CqD/aoZ/L4E2c+zkVuw ocK8DmXGB6GU/F6OSrNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAqnE-000hUj-1U; Mon, 11 Jul 2022 10:37:32 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAqnA-000hTP-NN for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 10:37:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1657535848; x=1689071848; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=l241aSfbDFRaiDAjISjeppEbmJl16Z4pyYiIsz0YFbE=; b=kFTDr3rmwXJax+crU4RzcCK62Ka8J9AnC+4RtqN1JFaOWlwzbRPGtsBJ oRe/cJMjqs07QH+LNisAB+2gKSuVFe3W1JoSF45ueMPbw6yxjCiRvn/NE 9X7zm/Vn02yt4KKLf8gZjXX50ixgUL4LC7hR1h3ppfnUlLPbfRfbtCWmH KERaSNd1DqSvfcZAnY/Hz+7KJOZpltooap1NaChIseMf2kwEhiKPFN1aQ w6B6DtuZYNj/0MN0v5vD0j+v560W3xPeTTLMcaI0MDmu2TFL3reeZbA4e tJBn4mzZIJJ2GNYkPXBxNeh1eAwXCks27T7lVZxFG2WSVe5gaOeuRojp7 Q==; X-IronPort-AV: E=Sophos;i="5.92,262,1650902400"; d="scan'208";a="317495208" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 11 Jul 2022 18:37:25 +0800 IronPort-SDR: RV4U6YIi5zZDLbvqVJuZU45YvxnzfzvzfwordVjD7+PAbqWg7C0++j0lOalp6nHt6UeJ8R9kS4 40QvVZEPm3pf5c///6s3sOwMAHpOWGtehfrRZXH2U+AliGXGNElKQnAh+REEOT1VkQelFYU5Ii WLhEKRDJuPe4CiITU6DtP8RQrwX3bLUseYc0L5frHRwuWUMFeuTnUwy+YwZBVOM+GI4tqu+BTN kcGsm2tOM6/kaWD8iROxPRhjefnUZNZrVfziqTi87qGYHPsa2M1r5rdmxBNC6YLqGD5sO83LqM WdEW3OC4SBOF5VukOeVJZNOQ Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Jul 2022 02:59:03 -0700 IronPort-SDR: or5UU+hEI3P4DS8o9vKT0eGTyoiyVtTVoLqS9T5Jhcshy9l4iIIM50eK44157Vr1bRpIh6MlP7 vYwfcW8m/FrbUdmWfkyaXuaFEhcfKOixJse1a+BUc2h1wJNXccCiUZkBQ9JUfgV3y/niK0VpLK 8TvTLvIDhHkgfKzAniwfOKhPgDZ3E6iPzzafPv1NDjbk+ISMQyj4I/RLxk3OptX9hq7wWIQmku 4jNdaXCwW8Te7HkGisD6g2uePglm/God08jeDNW47s3JTBIYXXViU+AUJDAAoeQO7qQe9ZjE48 ozg= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Jul 2022 03:37:26 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4LhL1K27nSz1Rws6 for ; Mon, 11 Jul 2022 03:37:25 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1657535843; x=1660127844; bh=l241aSfbDFRaiDAjISjeppEbmJl16Z4pyYi Isz0YFbE=; b=D+dgphWpbQtmqqcc+FxZZu/64TAs2ZjAGXSftALS1SDOGp7JQ2f CojEAzzUBnuw5csmiCrKaHDxOtEc8Wgzjh0p2Kx2llCSyJ38Zq2b26gcEI2QxVGz UGP2IkTZlpJS0rWVu5TDB5ra9RlnJ+7dVnVObunIaEwcK6cPbN8TM0jOL7clnFxg MzorR70DpeqCUgXpFLsMShGYPICq8ZePrdOSlyzjMUdXSaWJJavhbfKdtNMnA6SU KVCZJ8OXnF+LkWEZsOwuiT7xuKM5OwJNcYlUMwkuNPuk47HgDgv11QRu3/L9ZDp4 BzuiWBvw6YFJqZqLJG7Z3YL/qQUoSu6rHvA== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ricdheo5G54z for ; Mon, 11 Jul 2022 03:37:23 -0700 (PDT) Received: from [10.225.163.114] (unknown [10.225.163.114]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4LhL1F1m4vz1RtVk; Mon, 11 Jul 2022 03:37:21 -0700 (PDT) Message-ID: Date: Mon, 11 Jul 2022 19:37:19 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1 25/33] ata/drivers/ahci_imx: Switch to new of thermal API Content-Language: en-US To: Daniel Lezcano , Daniel Lezcano , 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, Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , "open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" References: <20220710212423.681301-1-daniel.lezcano@linexp.org> <20220710212423.681301-26-daniel.lezcano@linexp.org> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_033728_821878_3C8CD405 X-CRM114-Status: GOOD ( 26.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/11/22 18:14, Daniel Lezcano wrote: > On 11/07/2022 01:18, Damien Le Moal wrote: >> On 7/11/22 06: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/ata/ahci_imx.c | 15 ++++++++++----- >>> 1 file changed, 10 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c >>> index 79aa9f285312..5ad9a890e71a 100644 >>> --- a/drivers/ata/ahci_imx.c >>> +++ b/drivers/ata/ahci_imx.c >>> @@ -327,7 +327,7 @@ static int read_adc_sum(void *dev, u16 rtune_ctl_reg, void __iomem * mmio) >>> } >>> >>> /* SATA AHCI temperature monitor */ >>> -static int sata_ahci_read_temperature(void *dev, int *temp) >>> +static int __sata_ahci_read_temperature(void *dev, int *temp) >>> { >>> u16 mpll_test_reg, rtune_ctl_reg, dac_ctl_reg, read_sum; >>> u32 str1, str2, str3, str4; >>> @@ -416,6 +416,11 @@ static int sata_ahci_read_temperature(void *dev, int *temp) >>> return 0; >>> } >>> >>> +static int sata_ahci_read_temperature(struct thermal_zone_device *tz, int *temp) >>> +{ >>> + return __sata_ahci_read_temperature(tz->devdata, temp); >>> +} >>> + >>> static ssize_t sata_ahci_show_temp(struct device *dev, >>> struct device_attribute *da, >>> char *buf) >>> @@ -423,14 +428,14 @@ static ssize_t sata_ahci_show_temp(struct device *dev, >>> unsigned int temp = 0; >>> int err; >>> >>> - err = sata_ahci_read_temperature(dev, &temp); >>> + err = __sata_ahci_read_temperature(dev, &temp); >>> if (err < 0) >>> return err; >>> >>> return sprintf(buf, "%u\n", temp); >>> } >> >> I do not see why the above changes are necessary. Please explain. > > sata_ahci_read_temperature() is used by sata_ahci_show_temp() also. > > So in order to change the function prototype for the get_temp ops which > does not take a void* but a thermal_zone_device* structure, this > function wraps the call. > > Do you prefer sata_ahci_read_temperature() becomes sata_ahci_get_temp() > and keep __sata_ahci_read_temperature() name untouched ? Understood. You can keep the name changes you have, but please add this explanation to the commit message. > >>> >>> -static const struct thermal_zone_of_device_ops fsl_sata_ahci_of_thermal_ops = { >>> +static struct thermal_zone_device_ops fsl_sata_ahci_of_thermal_ops = { >> >> Why remove the const ? >> >>> .get_temp = sata_ahci_read_temperature, >>> }; >>> >>> @@ -1131,8 +1136,8 @@ static int imx_ahci_probe(struct platform_device *pdev) >>> ret = PTR_ERR(hwmon_dev); >>> goto disable_clk; >>> } >>> - devm_thermal_zone_of_sensor_register(hwmon_dev, 0, hwmon_dev, >>> - &fsl_sata_ahci_of_thermal_ops); >>> + devm_thermal_of_zone_register(hwmon_dev, 0, hwmon_dev, >>> + &fsl_sata_ahci_of_thermal_ops); >> >> This is the only change that seems necessary. >> >>> dev_info(dev, "%s: sensor 'sata_ahci'\n", dev_name(hwmon_dev)); >>> } >>> >> >> And it is hard to review a patch without the full series for context. >> Please send all patches next time. >> >> > > -- Damien Le Moal Western Digital Research _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel