[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <870f8623-8a99-09b6-56c6-0f8c010af237@kernel.org>
Date: Tue, 22 Mar 2022 09:56:22 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Lh Kuo 郭力豪 <lh.Kuo@...plus.com>,
Li-hao Kuo <lhjeff911@...il.com>,
"rafael@...nel.org" <rafael@...nel.org>,
"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
"amitk@...nel.org" <amitk@...nel.org>,
"rui.zhang@...el.com" <rui.zhang@...el.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: Wells Lu 呂芳騰 <wells.lu@...plus.com>
Subject: Re: [PATCH v5 1/2] thermal: Add thermal driver for Sunplus SP7021
On 22/03/2022 03:55, Lh Kuo 郭力豪 wrote:
>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> + if (IS_ERR(res))
>>> + return dev_err_probe(&pdev->dev, PTR_ERR(res), "resource get
>>> +fail\n");
>>> +
>>> + sp_data->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
>>> + if (IS_ERR(sp_data->regs))
>>> + return dev_err_probe(&pdev->dev, PTR_ERR(sp_data->regs), "mas_base
>>> +get fail\n");
>>
>> Use devm_platform_ioremap_resource() instead.
>>
>
> Other drivers must also access these registers.
> Warning when using devm_platform_ioremap_resource
> Can I keep the original settings?
You should not map one region twice. How do you guarantee
synchronization during for example updates of specific registers? In
such case you need to use regmap and share it via syscon (although this
does not solve synchronization on higher level - avoiding conflicting
changes to same registers)
Best regards,
Krzysztof
Powered by blists - more mailing lists