From: Philipp Zabel <p.zabel@pengutronix.de>
To: Fabio Estevam <fabio.estevam@freescale.com>
Cc: linux-input@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
festevam@gmail.com, Ashish Jangam <ashish.jangam@kpitcummins.com>
Subject: Re: [PATCH] Input: da9052_tsi: make TSI reference regulator configurable
Date: Fri, 22 Mar 2013 16:55:58 +0100 [thread overview]
Message-ID: <1363967758.4019.77.camel@pizza.hi.pengutronix.de> (raw)
In-Reply-To: <514C7DFB.8000708@freescale.com>
Hi Fabio,
thank you for the comments.
Am Freitag, den 22.03.2013, 12:51 -0300 schrieb Fabio Estevam:
> Philipp Zabel wrote:
>
> > if (!tsi->stopped) {
> > + error = regulator_enable(tsi->tsiref);
> > + if (error < 0) {
> > + dev_err(tsi->da9052->dev,
> > + "Failed to enable TSIREF regualtor: %d\n",
>
> s/regualtor/regulator
I'll correct that.
> > @@ -274,12 +287,20 @@ static int da9052_ts_probe(struct platform_device *pdev)
> > /* Disable ADC */
> > da9052_ts_adc_toggle(tsi, false);
> >
> > + tsi->tsiref = regulator_get(tsi->da9052->dev, "tsiref");
>
> You could use devm_regulator_get here ...
I chose not to use devm_... because tsi->da9052->dev is not pdev->dev
here, but thinking about it, no harm will be done if regulator_put is
only called by the parent device's remove function. I'll switch to
devm_regulator_get if nobody minds.
> > + if (IS_ERR(tsi->tsiref)) {
> > + dev_err(tsi->da9052->dev,
> > + "Failed to get TSIREF regulator: %ld\n",
> > + PTR_ERR(tsi->tsiref));
> > + goto err_free_mem;
> > + }
> > +
> > error = da9052_request_irq(tsi->da9052, DA9052_IRQ_PENDOWN,
> > "pendown-irq", da9052_ts_pendwn_irq, tsi);
> > if (error) {
> > dev_err(tsi->da9052->dev,
> > "Failed to register PENDWN IRQ: %d\n", error);
> > - goto err_free_mem;
> > + goto err_put_reg;
> > }
> >
> > error = da9052_request_irq(tsi->da9052, DA9052_IRQ_TSIREADY,
> > @@ -310,6 +331,8 @@ err_free_datardy_irq:
> > da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi);
> > err_free_pendwn_irq:
> > da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi);
> > +err_put_reg:
> > + regulator_put(tsi->tsiref);
> > err_free_mem:
> > kfree(tsi);
> > input_free_device(input_dev);
> > @@ -321,10 +344,9 @@ static int da9052_ts_remove(struct platform_device *pdev)
> > {
> > struct da9052_tsi *tsi = platform_get_drvdata(pdev);
> >
> > - da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x19);
> > -
> > da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi);
> > da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi);
> > + regulator_put(tsi->tsiref);
>
> and then no need to use the regulator_put.
regards
Philipp
next prev parent reply other threads:[~2013-03-22 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 14:55 [PATCH] Input: da9052_tsi: make TSI reference regulator configurable Philipp Zabel
2013-03-22 15:51 ` Fabio Estevam
2013-03-22 15:55 ` Philipp Zabel [this message]
[not found] ` <514C7DFB.8000708-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-03-22 15:58 ` Dmitry Torokhov
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=1363967758.4019.77.camel@pizza.hi.pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=ashish.jangam@kpitcummins.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dmitry.torokhov@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=linux-input@vger.kernel.org \
/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).