From: Thierry Reding <thierry.reding@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH 4/4] drm/panel: s6e8aa0: Use static inline for upcasting
Date: Tue, 22 Jul 2014 09:12:21 +0200 [thread overview]
Message-ID: <1406013141-18552-4-git-send-email-thierry.reding@gmail.com> (raw)
In-Reply-To: <1406013141-18552-1-git-send-email-thierry.reding@gmail.com>
From: Thierry Reding <treding@nvidia.com>
Use a static inline function for upcasting a struct drm_panel to the
driver-specific structure. The advantage over using a macro is that it
gives us additional type checking.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpu/drm/panel/panel-s6e8aa0.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-s6e8aa0.c b/drivers/gpu/drm/panel/panel-s6e8aa0.c
index d39bee36816c..6034d300d218 100644
--- a/drivers/gpu/drm/panel/panel-s6e8aa0.c
+++ b/drivers/gpu/drm/panel/panel-s6e8aa0.c
@@ -120,7 +120,10 @@ struct s6e8aa0 {
int error;
};
-#define panel_to_s6e8aa0(p) container_of(p, struct s6e8aa0, panel)
+static inline struct s6e8aa0 *panel_to_s6e8aa0(struct drm_panel *panel)
+{
+ return container_of(panel, struct s6e8aa0, panel);
+}
static int s6e8aa0_clear_error(struct s6e8aa0 *ctx)
{
--
2.0.1
next prev parent reply other threads:[~2014-07-22 7:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 7:12 [PATCH 1/4] drm/dsi: Make mipi_dsi_dcs_write() return ssize_t Thierry Reding
2014-07-22 7:12 ` [PATCH 2/4] drm/dsi: Use peripheral's channel for DCS commands Thierry Reding
2014-07-22 7:30 ` Andrzej Hajda
2014-07-22 7:12 ` [PATCH 3/4] drm/dsi: Make mipi_dsi_dcs_{read,write}() symmetrical Thierry Reding
2014-07-22 7:32 ` [PATCH 3/4] drm/dsi: Make mipi_dsi_dcs_{read, write}() symmetrical Andrzej Hajda
2014-07-22 8:12 ` Thierry Reding
2014-07-22 9:33 ` Andrzej Hajda
2014-07-23 7:51 ` Thierry Reding
2014-07-23 10:59 ` Andrzej Hajda
2014-07-23 13:37 ` Thierry Reding
2014-07-24 7:57 ` Andrzej Hajda
2014-07-24 9:31 ` Thierry Reding
2014-07-22 11:20 ` Daniel Vetter
2014-07-23 6:32 ` Andrzej Hajda
2014-07-22 7:12 ` Thierry Reding [this message]
2014-07-22 7:33 ` [PATCH 4/4] drm/panel: s6e8aa0: Use static inline for upcasting Andrzej Hajda
2014-07-22 7:28 ` [PATCH 1/4] drm/dsi: Make mipi_dsi_dcs_write() return ssize_t Andrzej Hajda
2014-07-22 9:50 ` YoungJun Cho
2014-07-22 10:05 ` Andrzej Hajda
2014-07-22 10:23 ` Andrzej Hajda
2014-07-23 7:27 ` Thierry Reding
2014-07-23 8:18 ` Andrzej Hajda
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=1406013141-18552-4-git-send-email-thierry.reding@gmail.com \
--to=thierry.reding@gmail.com \
--cc=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.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