From: Mehdi Djait <mehdi.djait@bootlin.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: mchehab@kernel.org, heiko@sntech.de, hverkuil-cisco@xs4all.nl,
krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org,
conor+dt@kernel.org, linux-media@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com,
maxime.chevallier@bootlin.com, paul.kocialkowski@bootlin.com,
michael.riesch@wolfvision.net
Subject: Re: [PATCH v9 2/3] media: rockchip: Add a driver for Rockchip's camera interface
Date: Tue, 31 Oct 2023 10:33:52 +0100 [thread overview]
Message-ID: <ZUDKAB+zQYS9aLpB@pc-70.home> (raw)
In-Reply-To: <ad346052-ec62-4d68-903e-fccd7ad989bd@wanadoo.fr>
Hello Christophe,
On Mon, Oct 30, 2023 at 01:47:17PM +0100, Christophe JAILLET wrote:
> > + /* Create & register platform subdev. */
> > + ret = cif_register_stream_vdev(cif_dev);
> > + if (ret < 0)
> > + goto err_unreg_media_dev;
> > +
> > + ret = cif_subdev_notifier(cif_dev);
> > + if (ret < 0) {
> > + v4l2_err(&cif_dev->v4l2_dev,
> > + "Failed to register subdev notifier(%d)\n", ret);
> > + cif_unregister_stream_vdev(cif_dev);
> > + goto err_unreg_media_dev;
>
> Should there be another label with cif_unregister_stream_vdev(cif_dev); if
> an error occurs here?
>
> CJ
cif_subdev_notifier() is the last function call in the probe with error
handling. So it will undo the last successful register:
cif_register_stream_vdev and use the goto to unregister the rest.
I can add a label err_unreg_stream_vdev but it will be only used in the
error handling of cif_subdev_notifier() and I don't see the benefit.
--
Kind Regards
Mehdi Djait
> > + }
> > +
> > + cif_set_default_format(cif_dev);
> > + pm_runtime_enable(&pdev->dev);
> > +
> > + return 0;
> > +
> > +err_unreg_media_dev:
> > + media_device_unregister(&cif_dev->media_dev);
> > +err_unreg_v4l2_dev:
> > + v4l2_device_unregister(&cif_dev->v4l2_dev);
> > + return ret;
> > +}
next prev parent reply other threads:[~2023-10-31 9:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 12:25 [PATCH v9 0/3] media: rockchip: Add a driver for Rockchip's camera interface Mehdi Djait
2023-10-30 12:25 ` [PATCH v9 1/3] media: dt-bindings: media: add bindings for Rockchip CIF Mehdi Djait
2023-10-30 19:32 ` Rob Herring
2023-10-31 9:51 ` Paul Kocialkowski
2023-11-01 15:44 ` Conor Dooley
2023-11-01 16:56 ` Paul Kocialkowski
2023-10-30 12:25 ` [PATCH v9 2/3] media: rockchip: Add a driver for Rockchip's camera interface Mehdi Djait
2023-10-30 12:47 ` Christophe JAILLET
2023-10-31 9:33 ` Mehdi Djait [this message]
2023-10-31 9:46 ` Christophe JAILLET
2023-10-31 9:53 ` Paul Kocialkowski
2023-10-31 22:23 ` Michael Riesch
2023-11-03 8:23 ` Mehdi Djait
2023-11-08 8:50 ` Michael Riesch
2023-11-08 10:46 ` Mehdi Djait
2023-11-02 10:39 ` Paul Kocialkowski
2023-10-30 12:25 ` [PATCH v9 3/3] arm64: dts: rockchip: Add the " Mehdi Djait
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=ZUDKAB+zQYS9aLpB@pc-70.home \
--to=mehdi.djait@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=hverkuil-cisco@xs4all.nl \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=mchehab@kernel.org \
--cc=michael.riesch@wolfvision.net \
--cc=paul.kocialkowski@bootlin.com \
--cc=robh+dt@kernel.org \
--cc=thomas.petazzoni@bootlin.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).