lkml.org 
[lkml]   [2020]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1 09/12] i2c: tegra: Clean up probe function
From
Date
03.09.2020 00:17, Dmitry Osipenko пишет:
> 03.09.2020 00:06, Michał Mirosław пишет:
>> On Mon, Aug 31, 2020 at 11:23:00PM +0300, Dmitry Osipenko wrote:
>>> The driver's probe function code is difficult to read and follow. This
>>> patch splits probe function into several logical parts that are easy to
>>> work with.
>>>
>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>> ---
>>> drivers/i2c/busses/i2c-tegra.c | 398 ++++++++++++++++++++-------------
>>> 1 file changed, 240 insertions(+), 158 deletions(-)
>> [...]
>>
>> I can see why you want to extract clock setup and combine DT-parsing parts,
>> but the rest is not that clear. At least the clock setup split should be
>> a separate patch, as it seems to require massive code motion.
>> For eg. runtime PM setup/disable or interrupt setup, I would actually suggest
>> to drop the parts as they make the code harder to follow (you have
>> a function doing nothing but calling another one).
>
> Okay, I guess indeed it will be better to squash couple functions back,
> but excluding functions that help to make error unwinding cleaner. Thank
> you for the suggestion!
>

Actually, looks like it will be fine to do exactly what you're
suggesting. I also noticed few more things to improve in the probe
function and other places.

BTW, you're looking at v1, but there is a v2 on the list already.

\
 
 \ /
  Last update: 2020-09-02 23:48    [W:0.079 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site