From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm: omapdrm: Perform initialization/cleanup at probe/remove time
Date: Wed, 14 Dec 2016 00:31:31 +0200 [thread overview]
Message-ID: <5391985.ILpPxKPQIQ@avalon> (raw)
In-Reply-To: <20161213214850.vksn74xcpv2fs7e6@phenom.ffwll.local>
Hi Daniel,
On Tuesday 13 Dec 2016 22:48:50 Daniel Vetter wrote:
> On Tue, Dec 13, 2016 at 11:41:09PM +0200, Laurent Pinchart wrote:
> > On Tuesday 13 Dec 2016 22:21:10 Daniel Vetter wrote:
> >> On Tue, Dec 13, 2016 at 05:21:43PM +0200, Laurent Pinchart wrote:
> >>> +
> >>> + /* Allocate and initialize the DRM device. */
> >>> + ddev = drm_dev_alloc(&omap_drm_driver, &pdev->dev);
> >>
> >> Since this is a driver you work on, embedding is recommended, see
> >> drm_dev_init(). Looks soo much better.
> >
> > How does that work with drm_dev_unref() then ? When the last reference
> > goes away drm_dev_release() will kfree() the drm_device instance, which is
> > only valid if I allocate it dynamically.
>
> This is drm, we only solve shit half-assed until we realize how silly
> we've been. Meanwhile just place the drm_device as the first thing in your
> driver struct.
I think I'll skip it for now, and revisit that when the drm_device ->release()
operation lands.
> The kerneldoc for drm_dev_init even bothers to explain this all!
Not in Dave's drm-next, only in an obscure tree that hardly anyone knows about
;-)
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2016-12-13 22:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-13 15:21 [PATCH 0/2] omapdrm: Remove .load/.unload midlayer Laurent Pinchart
2016-12-13 15:21 ` [PATCH 1/2] drm: omapdrm: Use sizeof(*var) instead of sizeof(type) for structures Laurent Pinchart
2016-12-13 21:12 ` Daniel Vetter
2016-12-13 21:26 ` Laurent Pinchart
2016-12-13 15:21 ` [PATCH 2/2] drm: omapdrm: Perform initialization/cleanup at probe/remove time Laurent Pinchart
2016-12-13 21:21 ` Daniel Vetter
2016-12-13 21:41 ` Laurent Pinchart
2016-12-13 21:48 ` Daniel Vetter
2016-12-13 22:31 ` Laurent Pinchart [this message]
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=5391985.ILpPxKPQIQ@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--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