From: Fabio Estevam <festevam@gmail.com>
To: Yongcai Huang <anson.huang@nxp.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
rtresidd@electromag.com.au,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Leonard Crestez <leonard.crestez@nxp.com>,
martink@posteo.de, linux-iio@vger.kernel.org,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
NXP Linux Team <linux-imx@nxp.com>
Subject: Re: [PATCH V2 2/2] iio: accell: mma8452: add optional vdd/vddio regulator operation support
Date: Mon, 10 Dec 2018 12:46:17 -0200 [thread overview]
Message-ID: <CAOMZO5DT-cRYpCWShQqE7oX7v262s6K1G=R3PfBHs9RHXiiH6A@mail.gmail.com> (raw)
In-Reply-To: <1544426368-16415-2-git-send-email-Anson.Huang@nxp.com>
On Mon, Dec 10, 2018 at 5:25 AM Anson Huang <anson.huang@nxp.com> wrote:
> @@ -1533,6 +1536,27 @@ static int mma8452_probe(struct i2c_client *client,
> data->client = client;
> mutex_init(&data->lock);
> data->chip_info = match->data;
> + data->vdd_reg = devm_regulator_get_optional(&client->dev, "vdd");
> + if (!IS_ERR(data->vdd_reg)) {
> + ret = regulator_enable(data->vdd_reg);
> + if (ret) {
> + dev_err(&client->dev, "failed to enable VDD regulator\n");
> + return ret;
> + }
> + } else if (data->vdd_reg == ERR_PTR(-EPROBE_DEFER)) {
> + return -EPROBE_DEFER;
> + }
> +
> + data->vddio_reg = devm_regulator_get_optional(&client->dev, "vddio");
> + if (!IS_ERR(data->vddio_reg)) {
> + ret = regulator_enable(data->vddio_reg);
> + if (ret) {
> + dev_err(&client->dev, "failed to enable VDDIO regulator\n");
> + return ret;
As mentioned in your other patch: you should disable the previously
enabled regulator in the error path.
prev parent reply other threads:[~2018-12-10 14:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 7:25 [PATCH V2 1/2] dt-bindings: iio: accel: mma8452: add optional power supply property Anson Huang
2018-12-10 7:25 ` [PATCH V2 2/2] iio: accell: mma8452: add optional vdd/vddio regulator operation support Anson Huang
2018-12-10 14:30 ` Martin Kepplinger
2018-12-10 14:46 ` Fabio Estevam [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='CAOMZO5DT-cRYpCWShQqE7oX7v262s6K1G=R3PfBHs9RHXiiH6A@mail.gmail.com' \
--to=festevam@gmail.com \
--cc=anson.huang@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo@embeddedor.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=leonard.crestez@nxp.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=martink@posteo.de \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@kernel.org \
--cc=rtresidd@electromag.com.au \
/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;
as well as URLs for NNTP newsgroup(s).