diff mbox

[RFC,12/16] Add DEVM_TEGRA_OUTPUT()

Message ID 1437486658-28365-13-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso July 21, 2015, 1:50 p.m. UTC
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

 drivers/gpu/drm/tegra/drm.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index 70930d262caf..8427f6b0832b 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -236,6 +236,21 @@  void tegra_output_connector_destroy(struct drm_connector *connector);
 
 void tegra_output_encoder_destroy(struct drm_encoder *encoder);
 
+static inline int devm_acquire_tegra_output(struct device *dev,
+					    const struct devm_resource *resource)
+{
+	struct tegra_output *output = dev_get_drvdata(dev) + resource->offset;
+
+	output->dev = dev;
+
+	return tegra_output_probe(output);
+}
+
+#define DEVM_TEGRA_OUTPUT(_struct, _member) {				\
+	.initfunc = devm_acquire_tegra_output,				\
+	.offset = offsetof_t(struct _struct, _member, struct tegra_output),	\
+}
+
 /* from dpaux.c */
 struct tegra_dpaux;
 struct drm_dp_link;