public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH RESEND 1/4] drm/sysfs: add a helper for extracting connector type from kobject
@ 2015-05-12  9:14 Jani Nikula
  2015-05-12  9:14 ` [PATCH RESEND 2/4] drm/sysfs: make optional attribute groups per connector type Jani Nikula
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jani Nikula @ 2015-05-12  9:14 UTC (permalink / raw)
  To: dri-devel, intel-gfx; +Cc: jani.nikula

This reduces duplication in the patches to follow. No functional
changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_sysfs.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index ffc305fc2076..33466999b59a 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -407,17 +407,23 @@ static struct attribute *connector_opt_dev_attrs[] = {
 	NULL
 };
 
-static umode_t connector_opt_dev_is_visible(struct kobject *kobj,
-					    struct attribute *attr, int idx)
+/* Connector type related helpers */
+static int kobj_connector_type(struct kobject *kobj)
 {
 	struct device *dev = kobj_to_dev(kobj);
 	struct drm_connector *connector = to_drm_connector(dev);
 
+	return connector->connector_type;
+}
+
+static umode_t connector_opt_dev_is_visible(struct kobject *kobj,
+					    struct attribute *attr, int idx)
+{
 	/*
 	 * In the long run it maybe a good idea to make one set of
 	 * optionals per connector type.
 	 */
-	switch (connector->connector_type) {
+	switch (kobj_connector_type(kobj)) {
 	case DRM_MODE_CONNECTOR_DVII:
 	case DRM_MODE_CONNECTOR_Composite:
 	case DRM_MODE_CONNECTOR_SVIDEO:
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-15 10:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-12  9:14 [PATCH RESEND 1/4] drm/sysfs: add a helper for extracting connector type from kobject Jani Nikula
2015-05-12  9:14 ` [PATCH RESEND 2/4] drm/sysfs: make optional attribute groups per connector type Jani Nikula
2015-05-12  9:14 ` [PATCH RESEND 3/4] drm/sysfs: split DVI-I and TV-out attributes Jani Nikula
2015-05-12  9:14 ` [PATCH RESEND 4/4] drm/sysfs: remove unnecessary connector type checks Jani Nikula
2015-05-15 10:22   ` shuang.he
2015-05-12 11:03 ` [PATCH RESEND 1/4] drm/sysfs: add a helper for extracting connector type from kobject Ville Syrjälä
2015-05-12 11:44   ` [Intel-gfx] " Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox