From: Renato Lui Geh <renatogeh@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Renato Lui Geh <renatogeh@gmail.com>,
lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org,
stefan.popa@analog.com, alexandru.Ardelean@analog.com,
giuliano.belinassi@usp.br, linux-iio@vger.kernel.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
kernel-usp@googlegroups.com
Subject: Re: [PATCH v2 2/2] staging: iio: ad7780: moving ad7780 out of staging
Date: Mon, 28 Jan 2019 11:39:50 -0200 [thread overview]
Message-ID: <20190128133949.z6eryxwes7yty3l2@renatolg> (raw)
In-Reply-To: <20190128125426.GG1795@kadam>
On 01/28, Dan Carpenter wrote:
>On Sun, Jan 27, 2019 at 06:33:52PM -0200, Renato Lui Geh wrote:
>> + st->reg = devm_regulator_get(&spi->dev, "avdd");
>> + if (IS_ERR(st->reg))
>> + return PTR_ERR(st->reg);
>> +
>> + ret = regulator_enable(st->reg);
>> + if (ret) {
>> + dev_err(&spi->dev, "Failed to enable specified AVdd supply\n");
>> + goto error_disable_reg;
>> + }
>
>We don't need to disable the regulator if enabling it failed (probably,
>I haven't looked at the code).
I wasn't sure if ret would need to be cleaned up on failure, so I kept
it as it was before. I'll change it to a simple return if needed though.
>
>
>> +
>> + ret = ad_sd_setup_buffer_and_trigger(indio_dev);
>> + if (ret)
>> + goto error_disable_reg;
>> +
>> + ret = iio_device_register(indio_dev);
>> + if (ret)
>> + goto error_cleanup_buffer_and_trigger;
>> +
>> + return 0;
>> +
>> +error_cleanup_buffer_and_trigger:
>> + ad_sd_cleanup_buffer_and_trigger(indio_dev);
>> +error_disable_reg:
>> + regulator_disable(st->reg);
>> +
>
>Well chosen label names, btw. Very easy to review.
That was already there before I came. But yes, very nice choice of
names. :)
>
>> + return ret;
>> +}
>> +
>
>regards,
>dan carpenter
next prev parent reply other threads:[~2019-01-28 13:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-27 20:33 [PATCH v2 2/2] staging: iio: ad7780: moving ad7780 out of staging Renato Lui Geh
2019-01-28 12:54 ` Dan Carpenter
2019-01-28 13:39 ` Renato Lui Geh [this message]
2019-02-02 9:44 ` Jonathan Cameron
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=20190128133949.z6eryxwes7yty3l2@renatolg \
--to=renatogeh@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=alexandru.Ardelean@analog.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=giuliano.belinassi@usp.br \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=kernel-usp@googlegroups.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=stefan.popa@analog.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;
as well as URLs for NNTP newsgroup(s).