lkml.org 
[lkml]   [2020]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 14/35] i2c: tegra: Clean up probe function
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.

--
With Best Regards,
Andy Shevchenko

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