linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: airlied@linux.ie, Fabian Frederick <fabf@skynet.be>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH 7/9 linux-next] drm/gma500: use container_of to resolve psb_fbdev from drm_fb_helper
Date: Sun, 14 Sep 2014 18:40:20 +0200	[thread overview]
Message-ID: <1410712823-29137-8-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1410712823-29137-1-git-send-email-fabf@skynet.be>

Use container_of instead of casting first structure member.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
Compiled but untested.

 drivers/gpu/drm/gma500/framebuffer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index d0dd3be..ddd90dd 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -540,7 +540,8 @@ static void psbfb_gamma_get(struct drm_crtc *crtc, u16 *red,
 static int psbfb_probe(struct drm_fb_helper *helper,
 				struct drm_fb_helper_surface_size *sizes)
 {
-	struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper;
+	struct psb_fbdev *psb_fbdev =
+		container_of(helper, struct psb_fbdev, psb_fb_helper);
 	struct drm_device *dev = psb_fbdev->psb_fb_helper.dev;
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	int bytespp;
-- 
1.9.1


  parent reply	other threads:[~2014-09-14 16:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-14 16:40 [PATCH 0/9 linux-next] drivers/gpu/drm: use container_of where possible Fabian Frederick
2014-09-14 16:40 ` [PATCH 1/9 linux-next] drm/cirrus: use container_of to resolve cirrus_fbdev from drm_fb_helper Fabian Frederick
2014-09-14 16:40 ` [PATCH 2/9 linux-next] drm/mgag200: use container_of to resolve mga_fbdev " Fabian Frederick
2014-09-14 16:40 ` [PATCH 3/9 linux-next] drm/radeon: use container_of to resolve radeon_fbdev " Fabian Frederick
2014-09-14 16:40 ` [PATCH 4/9 linux-next] drm/nouveau: use container_of to resolve nouveau_fbdev " Fabian Frederick
2014-09-14 16:40 ` [PATCH 5/9 linux-next] drm/nouveau: use container_of to resolve nouveau_plane from drm_plane Fabian Frederick
2014-09-14 16:40 ` [PATCH 6/9 linux-next] drm/qxl: use container_of to resolve qxl_fbdev from drm_fb_helper Fabian Frederick
2014-09-14 16:40 ` Fabian Frederick [this message]
2014-09-14 16:40 ` [PATCH 8/9 linux-next] drm/ast: use container_of to resolve ast_fbdev " Fabian Frederick
2014-09-14 16:40 ` [PATCH 9/9 linux-next] drm/udl: use container_of to resolve udl_fbdev " Fabian Frederick
2014-09-14 23:13 ` [PATCH 0/9 linux-next] drivers/gpu/drm: use container_of where possible One Thousand Gnomes
2014-09-15 18:15   ` Fabian Frederick
2014-09-17 10:01     ` Daniel Vetter
2014-09-17 10:49     ` One Thousand Gnomes

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=1410712823-29137-8-git-send-email-fabf@skynet.be \
    --to=fabf@skynet.be \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.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).