lkml.org 
[lkml]   [2020]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 14/35] i2c: tegra: Clean up probe function
From
Date
08.09.2020 11:40, Andy Shevchenko пишет:
> On Tue, Sep 8, 2020 at 5:11 AM Dmitry Osipenko <digetx@gmail.com> wrote:
>>
>> The driver's probe function code is a bit difficult to read. This patch
>> reorders code of the probe function, forming groups of code that are easy
>> to work with.
>>
>> The probe tear-down order now matches the driver-removal order.
>
>> All dev/&pdev->dev are replaced with i2c_dev->dev in order to have uniform
>> code style across the driver.
>
> You see, below is my point why leaving a temporary variable can reduce a churn.
>
>> The "ret" variable renamed to "err" since it only carries error code and
>> the new name clearly shows that.
>
> Overall it sounds like you need to split this into a few patches.
>
> ...
>
>> - struct device *dev = &pdev->dev;
>
>> - i2c_dev->rst = devm_reset_control_get_exclusive(&pdev->dev, "i2c");
>
>> + i2c_dev->rst = devm_reset_control_get_exclusive(i2c_dev->dev, "i2c");
>
> You see, if it had been simple 'dev', this line would have not been changed.
>
> And so on.
>

Alright, I'll move all the renamings into the "Clean up variable names"
patch, thanks.

\
 
 \ /
  Last update: 2020-09-08 21:43    [W:0.085 / U:3.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site