[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dd51a8eb-5b8d-0b63-3130-428980cfe7ff@gmail.com>
Date: Tue, 8 Sep 2020 16:16:26 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Wolfram Sang <wsa@...-dreams.de>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
linux-i2c <linux-i2c@...r.kernel.org>,
linux-tegra@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6 14/35] i2c: tegra: Clean up probe function
08.09.2020 11:40, Andy Shevchenko пишет:
> On Tue, Sep 8, 2020 at 5:11 AM Dmitry Osipenko <digetx@...il.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.
Powered by blists - more mailing lists