From: Mark Brown <broonie@kernel.org>
To: Chris Zhong <zyw@rock-chips.com>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
sameo@linux.intel.com, lee.jones@linaro.org, lgirdwood@gmail.com,
a.zummo@towertech.it, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
grant.likely@linaro.org, hl@rock-chips.com,
huangtao@rock-chips.com, cf@rock-chips.com,
zhangqing@rock-chips.com, xxx@rock-chips.com,
dianders@chromium.org, heiko@sntech.de, olof@lixom.net,
sonnyrao@chromium.org, dtor@chromium.org,
javier.martinez@collabora.co.uk, kever.yang@rock-chips.com
Subject: Re: [PATCH 3/4] RK808: Add rk808 regulator driver
Date: Sun, 17 Aug 2014 09:06:28 -0500 [thread overview]
Message-ID: <20140817140628.GG14537@sirena.org.uk> (raw)
In-Reply-To: <1408240839-29512-1-git-send-email-zyw@rock-chips.com>
[-- Attachment #1: Type: text/plain, Size: 1905 bytes --]
On Sun, Aug 17, 2014 at 10:00:39AM +0800, Chris Zhong wrote:
> The regulator module consists of 4 DCDCs, 8 LDOs and 2 switches.
> The output voltages are configurable and are meant to supply power
> to the main processor and other components
Looks very good - a few small nits below but otherwise fine. Please use
subject lines matching the style for the subsystem (regulator: in this
case).
> + reg_np = of_find_node_by_name(np, "regulators");
> + if (!reg_np)
> + return -ENXIO;
This needs to be find_child_by_name() otherwise it'll search the entire
device tree and might match other regulators in the system.
> + count = of_regulator_match(rk808->dev, reg_np, rk808_reg_matches,
> + rk808_NUM_REGULATORS);
Should really use RK808_NUM_REGULATORS as the name of the constant -
defines are always upper case.
> + pdata = rk808->pdata;
> + if (!pdata) {
> + dev_err(rk808->dev, "%s no pdata\n", __func__);
> + return -ENODEV;
> + }
Missing platform data should be fine for a regulator driver, it should
be able to start up and let the user read back how the device is
configured.
> + if (reg_data->constraints.name)
> + rail_name = reg_data->constraints.name;
> + else
> + rail_name = rk808_reg[i].name;
Don't do this, just use the rk808_reg name - the regulator core will
take care of applying the name from the constraints.
> + reg_data->supply_regulator = rail_name;
This should be fixed in the driver, it should be whatever the name the
device uses for the supply in the datasheet.
> + rk808_rdev = regulator_register(&rk808_reg[i], &config);
> + if (IS_ERR(rk808_rdev)) {
devm_regulator_register() and then you don't need to clean up on
removal.
> +MODULE_DESCRIPTION("regulator driver for the rk808 series PMICs");
> +MODULE_AUTHOR("Chris Zhong<zyw@rock-chips.com>");
> +MODULE_AUTHOR("Zhang Qing<zhanqging@rock-chips.com>");
Should have a space before the < here.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2014-08-17 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-17 2:00 [PATCH 3/4] RK808: Add rk808 regulator driver Chris Zhong
2014-08-17 14:06 ` Mark Brown [this message]
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=20140817140628.GG14537@sirena.org.uk \
--to=broonie@kernel.org \
--cc=a.zummo@towertech.it \
--cc=cf@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dtor@chromium.org \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=heiko@sntech.de \
--cc=hl@rock-chips.com \
--cc=huangtao@rock-chips.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=javier.martinez@collabora.co.uk \
--cc=kever.yang@rock-chips.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=olof@lixom.net \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=sameo@linux.intel.com \
--cc=sonnyrao@chromium.org \
--cc=xxx@rock-chips.com \
--cc=zhangqing@rock-chips.com \
--cc=zyw@rock-chips.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox