Re: [PATCH V3 5/6] thermal: rcar_thermal: Convert to devm_thermal_zone_of_sensor_register_params()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/20/2018 08:46 AM, Simon Horman wrote:
> On Thu, Dec 20, 2018 at 12:25:17AM +0100, Marek Vasut wrote:
>> On 12/18/2018 12:05 PM, Simon Horman wrote:
>>> On Mon, Dec 17, 2018 at 04:56:43PM +0100, marek.vasut@xxxxxxxxx wrote:
>>>> From: Marek Vasut <marek.vasut@xxxxxxxxx>
>>>>
>>>> Convert the rcar code to devm_thermal_zone_of_sensor_register_params(),
>>>> no functional change.
>>>>
>>>> From: Marek Vasut <marek.vasut+renesas@xxxxxxxxx>
>>>> Cc: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
>>>> Cc: Eduardo Valentin <edubezval@xxxxxxxxx>
>>>> Cc: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
>>>> Cc: Zhang Rui <rui.zhang@xxxxxxxxx>
>>>> Cc: linux-renesas-soc@xxxxxxxxxxxxxxx
>>>> To: linux-pm@xxxxxxxxxxxxxxx
>>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxx>
>>>> ---
>>>> V2: No change
>>>> V3: - Work around the From line and SoB line checkpatch warning
>>>>     - Reorder the SoB line at the end
>>>
>>> As per v2:
>>>
>>> This patch looks good to me, though I'm not sure why { } need
>>> to be introduced into the 4th hunk.
>>
>> Because it's a multi-line code , even though it's just a single
>> line-wrapped function call. I can drop that part, but I think it makes
>> it visually far more obvious where the conditional block starts/ends and
>> I recall seeing something about this in kernel coding style too.
> 
> I lean towards removing {} but I do not feel at all strongly about this.

Well does it improve the readability if they are removed ?

>> [...]
>>
>>>> @@ -554,16 +554,20 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>>>>  		if (ret < 0)
>>>>  			goto error_unregister;
>>>>  
>>>> -		if (chip->use_of_thermal)
>>>> -			priv->zone = devm_thermal_zone_of_sensor_register(
>>>> +		if (chip->use_of_thermal) {
>>>> +			priv->zone =
>>>> +				devm_thermal_zone_of_sensor_register_params(
>>>>  						dev, i, priv,
>>>> -						&rcar_thermal_zone_of_ops);
>>>> -		else
>>>> +						&rcar_thermal_zone_of_ops,
>>>> +						&rcar_thermal_params);
>>>> +		} else {
>>>>  			priv->zone = thermal_zone_device_register(
>>>>  						"rcar_thermal",
>>>>  						1, 0, priv,
>>>>  						&rcar_thermal_zone_ops, NULL, 0,
>>>>  						idle);
>>>> +		}
>>>> +
>>>>  		if (IS_ERR(priv->zone)) {
>>>>  			dev_err(dev, "can't register thermal zone\n");
>>>>  			ret = PTR_ERR(priv->zone);
>> [...]
>>
>> -- 
>> Best regards,
>> Marek Vasut
>>


-- 
Best regards,
Marek Vasut



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux