From: Marco Felsch <m.felsch@pengutronix.de>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: mchehab@kernel.org, laurent.pinchart+renesas@ideasonboard.com,
jacopo+renesas@jmondi.org, akinobu.mita@gmail.com,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@pengutronix.de
Subject: Re: [PATCH 2/4] media: mt9m111: fix subdev API usage
Date: Mon, 22 Aug 2022 09:51:01 +0200 [thread overview]
Message-ID: <20220822075101.75dv3cv2evb2qeqq@pengutronix.de> (raw)
In-Reply-To: <YwMiJYympE18tkmm@paasikivi.fi.intel.com>
Hi Sakari,
On 22-08-22, Sakari Ailus wrote:
> Hi Marco,
>
> On Thu, Aug 18, 2022 at 04:47:10PM +0200, Marco Felsch wrote:
> > In case of I2C transfer failures the driver return failure codes which
> > are not allowed according the API documentation. Fix that by ignore the
> > register access failure codes.
> >
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > ---
> > drivers/media/i2c/mt9m111.c | 116 ++++++++++++++++++++----------------
> > 1 file changed, 66 insertions(+), 50 deletions(-)
> >
> > diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
> > index cdaf283e1309..53c4dac4e4bd 100644
> > --- a/drivers/media/i2c/mt9m111.c
> > +++ b/drivers/media/i2c/mt9m111.c
> > @@ -455,7 +455,7 @@ static int mt9m111_set_selection(struct v4l2_subdev *sd,
> > struct mt9m111 *mt9m111 = to_mt9m111(client);
> > struct v4l2_rect rect = sel->r;
> > int width, height;
> > - int ret, align = 0;
> > + int align = 0;
> >
> > if (sel->which != V4L2_SUBDEV_FORMAT_ACTIVE ||
> > sel->target != V4L2_SEL_TGT_CROP)
> > @@ -481,14 +481,13 @@ static int mt9m111_set_selection(struct v4l2_subdev *sd,
> > width = min(mt9m111->width, rect.width);
> > height = min(mt9m111->height, rect.height);
> >
> > - ret = mt9m111_setup_geometry(mt9m111, &rect, width, height, mt9m111->fmt->code);
> > - if (!ret) {
> > - mt9m111->rect = rect;
> > - mt9m111->width = width;
> > - mt9m111->height = height;
> > - }
> >
> > - return ret;
> > + mt9m111_setup_geometry(mt9m111, &rect, width, height, mt9m111->fmt->code);
>
> If the function can fail, it'd be much better to move it to s_stream
> callback than ignore the error.
>
> Same for the rest of such changes.
I did that in the following patch, but I can merge them if you want.
Regards,
Marco
next prev parent reply other threads:[~2022-08-22 7:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 14:47 [PATCH 1/4] media: mt9m111: add V4L2_CID_PIXEL_RATE support Marco Felsch
2022-08-18 14:47 ` [PATCH 2/4] media: mt9m111: fix subdev API usage Marco Felsch
2022-08-19 7:16 ` Jacopo Mondi
2022-08-19 7:28 ` Marco Felsch
2022-08-19 7:40 ` Jacopo Mondi
2022-08-22 6:28 ` Sakari Ailus
2022-08-22 7:51 ` Marco Felsch [this message]
2022-08-22 9:17 ` Sakari Ailus
2022-08-18 14:47 ` [PATCH 3/4] media: mt9m111: fix device power usage Marco Felsch
2022-08-19 7:26 ` Jacopo Mondi
2022-08-19 7:32 ` Marco Felsch
2022-08-22 6:31 ` Sakari Ailus
2022-08-22 7:54 ` Marco Felsch
2022-08-22 9:18 ` Sakari Ailus
2022-08-23 14:44 ` Marco Felsch
2023-01-16 22:14 ` Sakari Ailus
2023-01-17 11:29 ` Marco Felsch
2023-01-17 11:32 ` Sakari Ailus
2022-08-18 14:47 ` [PATCH 4/4] media: mt9m111: remove .s_power callback Marco Felsch
2022-08-18 16:14 ` Jacopo Mondi
2022-08-19 7:18 ` Marco Felsch
2022-08-19 7:35 ` Jacopo Mondi
2022-08-19 8:06 ` Marco Felsch
2022-08-19 8:17 ` Jacopo Mondi
2022-08-18 16:11 ` [PATCH 1/4] media: mt9m111: add V4L2_CID_PIXEL_RATE support Jacopo Mondi
2022-08-19 7:56 ` Marco Felsch
2022-08-19 8:15 ` Jacopo Mondi
2022-08-19 9:04 ` Marco Felsch
2022-08-19 9:46 ` Jacopo Mondi
2022-08-19 10:06 ` Marco Felsch
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=20220822075101.75dv3cv2evb2qeqq@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=akinobu.mita@gmail.com \
--cc=jacopo+renesas@jmondi.org \
--cc=kernel@pengutronix.de \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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
all inboxes | Powered by JetHome®