[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a255211-5426-d78f-d266-cdb958f4c658@samsung.com>
Date: Fri, 28 Aug 2020 10:47:46 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: Dmitry Osipenko <digetx@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Georgi Djakov <georgi.djakov@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Peter De Schrijver <pdeschrijver@...dia.com>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Mikko Perttunen <cyndis@...si.fi>
Cc: linux-tegra@...r.kernel.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v5 13/36] PM / devfreq: tegra30: Use MC timings for
building OPP table
Hi,
On 8/15/20 1:47 AM, Dmitry Osipenko wrote:
> 14.08.2020 05:02, Chanwoo Choi пишет:
>> Hi Dmitry,
>>
>> I add the minor comment. Except of some comments, it looks good to me.
>
> Hello, Chanwoo! Thank you for the review!
>
> ...
>>> +struct tegra_devfreq_soc_data {
>>> + const char *mc_compatible;
>>> +};
>>> +
>>> +static const struct tegra_devfreq_soc_data tegra30_soc = {
>>> + .mc_compatible = "nvidia,tegra30-mc",
>>> +};
>>> +
>>> +static const struct tegra_devfreq_soc_data tegra124_soc = {
>>> + .mc_compatible = "nvidia,tegra124-mc",
>>> +};
> .
>>> + soc_data = of_device_get_match_data(&pdev->dev);
>>
>> I think that better to check whether 'soc_data' is not NULL.
>
> It's a quite common misconception among kernel developers that
> of_device_get_match_data() may "accidentally" return NULL, but it
> couldn't if every driver's of_match[] entry has a non-NULL .data field
> and because the OF-matching already happened at the driver's probe-time
> [1], which is the case of this driver.
>
> [1] https://elixir.bootlin.com/linux/v5.8/source/drivers/of/device.c#L189
>
> Hence the NULL-checking is unnecessary.
>
> When I first encountered the of_device_get_match_data(), I was also
> thinking that adding the NULL-checks is a good idea, but later on
> somebody pointed out to me (maybe Thierry) that it's unnecessary to do.
OK. Thanks.
>
>>> +
>>> + mc = tegra_get_memory_controller(soc_data->mc_compatible);
>>> + if (IS_ERR(mc))
>>> + return PTR_ERR(mc);
>>
>> You better to add error log.
>
> In practice we should get only -EPROBE_DEFER here ever. I'll consider
> adding the message in the next revision, at least just for consistency.
In order to handle -EPROBE_DEFER, recommend the using of dev_err_probe().
(snip)
--
Best Regards,
Chanwoo Choi
Samsung Electronics
Powered by blists - more mailing lists