From: Sakari Ailus <sakari.ailus@iki.fi>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: mchehab@kernel.org, robh+dt@kernel.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
c.barrett@framos.com, a.brela@framos.com
Subject: Re: [PATCH v2 2/3] media: i2c: Add IMX290 CMOS image sensor driver
Date: Thu, 29 Aug 2019 23:17:01 +0300 [thread overview]
Message-ID: <20190829201701.GA3568@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <20190829170415.GA4427@mani>
Hi Manivannan,
On Thu, Aug 29, 2019 at 10:34:15PM +0530, Manivannan Sadhasivam wrote:
...
> > > +static int imx290_set_fmt(struct v4l2_subdev *sd,
> > > + struct v4l2_subdev_pad_config *cfg,
> > > + struct v4l2_subdev_format *fmt)
> > > +{
> > > + struct imx290 *imx290 = to_imx290(sd);
> > > + const struct imx290_mode *mode;
> > > + struct v4l2_mbus_framefmt *format;
> > > + int i, ret = 0;
> >
> > Note that sub-device drivers need to serialise access through the uAPI to
> > their own data.
> >
>
> You mean guarding with mutex?
Yes, please.
...
> > > +static int imx290_get_regulators(struct device *dev, struct imx290 *imx290)
> > > +{
> > > + unsigned int i;
> > > +
> > > + for (i = 0; i < IMX290_NUM_SUPPLIES; i++)
> > > + imx290->supplies[i].supply = imx290_supply_name[i];
> > > +
> > > + return devm_regulator_bulk_get(dev, IMX290_NUM_SUPPLIES,
> > > + imx290->supplies);
> > > +}
> > > +
...
> > > + ret = imx290_get_regulators(dev, imx290);
> > > + if (ret < 0) {
> > > + dev_err(dev, "Cannot get regulators\n");
> > > + return ret;
> > > + }
> > > +
> > > + imx290->rst_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS);
> > > + if (IS_ERR(imx290->rst_gpio)) {
> > > + dev_err(dev, "Cannot get reset gpio\n");
> >
> > Remember to put the regulators from now on. Or grab them later.
> >
>
> Shouldn't that happen by default with devm_regulator* APIs?
Ah, I missed you were using the devm variant. Please ignore the comment
then.
--
Regards,
Sakari Ailus
next prev parent reply other threads:[~2019-08-29 20:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 13:09 [PATCH v2 0/3] Add IMX290 CMOS image sensor support Manivannan Sadhasivam
2019-08-06 13:09 ` [PATCH v2 1/3] dt-bindings: media: i2c: Add IMX290 CMOS sensor binding Manivannan Sadhasivam
2019-08-13 9:45 ` Sakari Ailus
2019-08-13 11:33 ` Manivannan Sadhasivam
2019-08-13 11:46 ` Sakari Ailus
2019-08-13 12:14 ` Manivannan Sadhasivam
2019-08-13 12:22 ` Sakari Ailus
2019-08-13 13:52 ` Manivannan Sadhasivam
2019-08-13 14:18 ` Sakari Ailus
2019-08-13 11:38 ` Russell King - ARM Linux admin
2019-08-13 11:51 ` Manivannan Sadhasivam
2019-08-13 11:52 ` Sakari Ailus
2019-08-13 11:54 ` Sakari Ailus
2019-08-13 12:16 ` Manivannan Sadhasivam
2019-08-06 13:09 ` [PATCH v2 2/3] media: i2c: Add IMX290 CMOS image sensor driver Manivannan Sadhasivam
2019-08-13 10:59 ` Sakari Ailus
2019-08-29 17:04 ` Manivannan Sadhasivam
2019-08-29 20:17 ` Sakari Ailus [this message]
2019-08-06 13:09 ` [PATCH v2 3/3] MAINTAINERS: Add entry for " Manivannan Sadhasivam
2019-08-13 9:23 ` Sakari Ailus
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=20190829201701.GA3568@valkosipuli.retiisi.org.uk \
--to=sakari.ailus@iki.fi \
--cc=a.brela@framos.com \
--cc=c.barrett@framos.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mchehab@kernel.org \
--cc=robh+dt@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).