From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757364AbcASH0T (ORCPT ); Tue, 19 Jan 2016 02:26:19 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:61482 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752310AbcASH0Q (ORCPT ); Tue, 19 Jan 2016 02:26:16 -0500 X-AuditID: cbfec7f5-f79b16d000005389-c8-569de515efb6 Subject: Re: [PATCH V3 5/5] regulator: max77620: add regulator driver for max77620/max20024 To: Laxman Dewangan , robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, linus.walleij@linaro.org, gnurou@gmail.com, lee.jones@linaro.org, broonie@kernel.org, a.zummo@towertech.it, alexandre.belloni@free-electrons.com References: <1452771166-13694-1-git-send-email-ldewangan@nvidia.com> <1452771166-13694-6-git-send-email-ldewangan@nvidia.com> <569DC9AD.7000504@samsung.com> <569DDFEE.4080307@nvidia.com> Cc: lgirdwood@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, rtc-linux@googlegroups.com, swarren@nvidia.com, treding@nvidia.com, Mallikarjun Kasoju From: Krzysztof Kozlowski X-Enigmail-Draft-Status: N1110 Message-id: <569DE510.8090606@samsung.com> Date: Tue, 19 Jan 2016 16:26:08 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: <569DDFEE.4080307@nvidia.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsVy+t/xq7qiT+eGGbQcF7ZYcvEqu0XHtcVM FlMfPmGzmH/kHKtF/5uFrBbnXj1iARIrGS1evzC0WLpvNYvF/a9HGS2+XelgspjyZzmTxeb5 fxgtLu+aw2ax9PpFJot7e1ewWUyYvpbFonXvEXaL/Z0djBY3prewWtz+zecg6rFm3hpGj8t9 vUweTzZdZPTYOesuu8eeiSfZPFYu/8LmsWlVJ5vHnWt72Dx6m9+xefRtWcXoMX3eTyaPz5vk AniiuGxSUnMyy1KL9O0SuDJOd3YwFSwWrei7/pi5gfGiQBcjJ4eEgInE8/nHmCFsMYkL99az dTFycQgJLGWU2DrzIhOE85RR4sfaZkaQKmGBWInXa3aCJUQEtjNJbLrxjBGiah+jxMwNR9hB HGaBB4wSc6a8BhvMJmAssXn5EjaIJXISvd2TWEBsXgEtiZtPJwB1c3CwCKhK/LtqBxIWFYiQ ONzZxQ5RIijxY/I9sHJOoPITE6+BlTML6Encv6gFEmYWkJfYvOYt8wRGwVlIOmYhVM1CUrWA kXkVo2hqaXJBcVJ6rpFecWJucWleul5yfu4mRkg0f93BuPSY1SFGAQ5GJR7eF45zw4RYE8uK K3MPMUpwMCuJ8AY9BArxpiRWVqUW5ccXleakFh9ilOZgURLnnbnrfYiQQHpiSWp2ampBahFM lomDU6qBMU63MjJiqvWx9as+pBj0zPj14k1j/Qdjw8utkrMmzrbYVuWcG6YluGPL0qbZJvuU eu93B/gkWV91f9nm1x+xmeHkpfbO3vTDW9aFW1evOnxx53L/w3tFop5+v9k7Pf0l1yfhaNPn UYaaB2UvW1v/87178ADTJc0bP9cr7ZaVXd+dxezpsUI3SImlOCPRUIu5qDgRAK/VPgDiAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.01.2016 16:04, Laxman Dewangan wrote: > Thanks for review. > Here is my view on the some of the review comment. > > On Tuesday 19 January 2016 10:59 AM, Krzysztof Kozlowski wrote: >> On 14.01.2016 20:32, Laxman Dewangan wrote: > >> + return ret; >> +} >> + >> +static int max77620_init_pmic(struct max77620_regulator *pmic, int id) >> +{ >> This function seems to be used only from max77620_of_parse_cb(). I would >> find easier to read if this was located before definition of >> max77620_of_parse_cb(). Can you move it (or you had other idea of >> placing algorithm)? > > I wanted to keep all local function on top which is used on this file > and not the regulator ops. > Then implement regulator ops and then probe. > Let me see if I can do anything here. Ah, OK then. That kind of order makes sense as well. > >> >>> + pmic->enable_power_mode[id]) { >>> + ret = max77620_regulator_set_power_mode( >>> + pmic, pmic->enable_power_mode[id], id); >> The 'pmic' argument should be after opening parenthesis, not at new line. > > This is done for indenting alignment. I am using checkpatch --strict > option and for this the next line should be on same column of first > charcter after opening parenthesis. > To avoid this error, if we want to re-align the indenting for next line > then left the line empty after "(". But the next line is not aligned with the function call. So the 'strict' is not followed and the code is less readable. Instead this should be something like: + ret = max77620_regulator_set_power_mode(pmic + pmic->enable_power_mode[id], id); You cannot align it with function call anyway (to many indentations and too long name of function). > > + > +static int __init max77620_regulator_init(void) > +{ > + return platform_driver_register(&max77620_regulator_driver); > +} > +subsys_initcall(max77620_regulator_init); > + > >> Does it have to be subsys_initcall? Any special requirements for >> ordering the drivers? Probe deferring is encouraged instead. >> >> > > > This is to make sure th regulators are ready before other driver get > probed. This is basic need of some of driver and hence subsys_initcall. > I will move to module_init() as some of other PMIC driver (as3722) is in > the module init and used in tegra platform so not seeing much issue on > this. The other driver should support deferred probe and then the problem is somehow solved. There are some rare cases when this does not work yet but then please describe exactly which driver cannot work with it. For example max77802 regulator works well. Best regards, Krzysztof