From: Krzysztof Kozlowski <k.kozlowski@samsung.com> To: Laxman Dewangan <ldewangan@nvidia.com>, 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 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 <mkasoju@nvidia.com> Subject: Re: [PATCH V3 5/5] regulator: max77620: add regulator driver for max77620/max20024 Date: Tue, 19 Jan 2016 16:26:08 +0900 [thread overview] Message-ID: <569DE510.8090606@samsung.com> (raw) In-Reply-To: <569DDFEE.4080307@nvidia.com> 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
WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <k.kozlowski@samsung.com> To: Laxman Dewangan <ldewangan@nvidia.com>, 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 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 <mkasoju@nvidia.com> Subject: [rtc-linux] Re: [PATCH V3 5/5] regulator: max77620: add regulator driver for max77620/max20024 Date: Tue, 19 Jan 2016 16:26:08 +0900 [thread overview] Message-ID: <569DE510.8090606@samsung.com> (raw) In-Reply-To: <569DDFEE.4080307@nvidia.com> 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 -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
next prev parent reply other threads:[~2016-01-19 7:26 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-01-14 11:32 [PATCH V3 0/5] Add support for MAXIM MAX77620/MAX20024 PMIC Laxman Dewangan 2016-01-14 11:32 ` [rtc-linux] " Laxman Dewangan 2016-01-14 11:32 ` Laxman Dewangan 2016-01-14 11:32 ` [PATCH V3 1/5] DT: mfd: add device-tree binding doc fro PMIC max77620/max20024 Laxman Dewangan 2016-01-14 11:32 ` [rtc-linux] " Laxman Dewangan 2016-01-14 11:32 ` Laxman Dewangan 2016-01-15 2:55 ` Rob Herring 2016-01-15 2:55 ` [rtc-linux] " Rob Herring [not found] ` <1452771166-13694-2-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> 2016-01-27 9:42 ` Linus Walleij 2016-01-27 9:42 ` [rtc-linux] " Linus Walleij 2016-01-27 9:42 ` Linus Walleij 2016-01-14 11:32 ` [PATCH V3 2/5] mfd: max77620: add core driver for MAX77620/MAX20024 Laxman Dewangan 2016-01-14 11:32 ` [rtc-linux] " Laxman Dewangan 2016-01-14 11:32 ` Laxman Dewangan 2016-01-19 5:13 ` Krzysztof Kozlowski 2016-01-19 5:13 ` [rtc-linux] " Krzysztof Kozlowski 2016-01-14 11:32 ` [PATCH V3 3/5] pinctrl: max77620: add pincontrol " Laxman Dewangan 2016-01-14 11:32 ` [rtc-linux] " Laxman Dewangan 2016-01-14 11:32 ` Laxman Dewangan 2016-01-14 11:32 ` [PATCH V3 4/5] gpio: max77620: add gpio " Laxman Dewangan 2016-01-14 11:32 ` [rtc-linux] " Laxman Dewangan 2016-01-14 11:32 ` Laxman Dewangan 2016-01-14 11:32 ` [PATCH V3 5/5] regulator: max77620: add regulator driver for max77620/max20024 Laxman Dewangan 2016-01-14 11:32 ` [rtc-linux] " Laxman Dewangan 2016-01-14 11:32 ` Laxman Dewangan 2016-01-19 5:29 ` Krzysztof Kozlowski 2016-01-19 5:29 ` [rtc-linux] " Krzysztof Kozlowski 2016-01-19 7:04 ` Laxman Dewangan 2016-01-19 7:04 ` [rtc-linux] " Laxman Dewangan 2016-01-19 7:04 ` Laxman Dewangan 2016-01-19 7:26 ` Krzysztof Kozlowski [this message] 2016-01-19 7:26 ` [rtc-linux] " Krzysztof Kozlowski
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=569DE510.8090606@samsung.com \ --to=k.kozlowski@samsung.com \ --cc=a.zummo@towertech.it \ --cc=alexandre.belloni@free-electrons.com \ --cc=broonie@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=galak@codeaurora.org \ --cc=gnurou@gmail.com \ --cc=ijc+devicetree@hellion.org.uk \ --cc=ldewangan@nvidia.com \ --cc=lee.jones@linaro.org \ --cc=lgirdwood@gmail.com \ --cc=linus.walleij@linaro.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=mkasoju@nvidia.com \ --cc=pawel.moll@arm.com \ --cc=robh+dt@kernel.org \ --cc=rtc-linux@googlegroups.com \ --cc=swarren@nvidia.com \ --cc=treding@nvidia.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.