From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jyri Sarha <jsarha@ti.com>
Cc: khilman@baylibre.com, dri-devel@lists.freedesktop.org,
peter.ujfalusi@ti.com, bgolaszewski@baylibre.com,
tomi.valkeinen@ti.com
Subject: Re: [PATCH v5 3/4] drm/bridge: Add ti-tfp410 DVI transmitter driver
Date: Tue, 29 Nov 2016 22:26:43 +0200 [thread overview]
Message-ID: <1685230.NGdOFuNygN@avalon> (raw)
In-Reply-To: <eb2beb7e-750b-abf2-8823-8a634b452bd8@ti.com>
Hi Jyri,
On Tuesday 29 Nov 2016 22:18:25 Jyri Sarha wrote:
> The module unload should not be allowed while the bridge is attached. So
> still need to add these:
>
> On 11/25/16 11:02, Jyri Sarha wrote:
> > +
> > +static int tfp410_attach(struct drm_bridge *bridge)
> > +{
> > + struct tfp410 *dvi = drm_bridge_to_tfp410(bridge);
> > + int ret;
> > +
>
> + if (!try_module_get(THIS_MODULE)) {
> + dev_err(dvi->dev, "Module unloading\n");
> + return -ENODEV;
> + }
> +
Shouldn't this be done in core code ?
> > + if (!bridge->encoder) {
> > + dev_err(dvi->dev, "Missing encoder\n");
> > + return -ENODEV;
> > + }
> > +
> > + drm_connector_helper_add(&dvi->connector,
> > + &tfp410_con_helper_funcs);
> > + ret = drm_connector_init(bridge->dev, &dvi->connector,
> > + &tfp410_con_funcs, DRM_MODE_CONNECTOR_HDMIA);
> > + if (ret) {
> > + dev_err(dvi->dev, "drm_connector_init() failed: %d\n", ret);
> > + return ret;
> > + }
> > +
> > + drm_mode_connector_attach_encoder(&dvi->connector,
> > + bridge->encoder);
> > +
> > + return 0;
> > +}
>
> +static void tfp410_detach(struct drm_bridge *bridge)
> +{
> + module_put(THIS_MODULE);
> +}
> +
>
> > +
> > +static const struct drm_bridge_funcs tfp410_bridge_funcs = {
> > + .attach = tfp410_attach,
>
> + .detach = tfp410_detach,
>
> > +};
> > +
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-11-29 20:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 9:02 [PATCH v5 0/4] drm/tilcdc: Add bridge support and sync-lost flood recovery Jyri Sarha
2016-11-25 9:02 ` [PATCH v5 1/4] drm/tilcdc: Recover from sync lost error flood by resetting the LCDC Jyri Sarha
2016-11-25 9:02 ` [PATCH v5 2/4] dt-bindings: Move "ti, tfp410.txt" from display/ti to display/bridge Jyri Sarha
2016-11-25 9:02 ` [PATCH v5 3/4] drm/bridge: Add ti-tfp410 DVI transmitter driver Jyri Sarha
2016-11-29 20:18 ` Jyri Sarha
2016-11-29 20:26 ` Laurent Pinchart [this message]
2016-11-29 21:09 ` Jyri Sarha
2016-11-25 9:02 ` [PATCH v5 4/4] drm/tilcdc: Add drm bridge support for attaching drm bridge drivers Jyri Sarha
2016-11-29 20:18 ` Jyri Sarha
2016-11-29 20:27 ` Laurent Pinchart
2016-11-25 11:15 ` [PATCH v5 0/4] drm/tilcdc: Add bridge support and sync-lost flood recovery Bartosz Golaszewski
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=1685230.NGdOFuNygN@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=bgolaszewski@baylibre.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=khilman@baylibre.com \
--cc=peter.ujfalusi@ti.com \
--cc=tomi.valkeinen@ti.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).