lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1439207974-30902-1-git-send-email-srinivas.kandagatla@linaro.org>
Date:	Mon, 10 Aug 2015 12:59:34 +0100
From:	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:	dri-devel@...ts.freedesktop.org, robdclark@...il.com
Cc:	David Airlie <airlied@...ux.ie>, linux-kernel@...r.kernel.org,
	Rob Herring <robh+dt@...nel.org>,
	linux-arm-msm@...r.kernel.org,
	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH RFC 2/5] drm/msm/hdmi: make use of standard gpio properties.

This patch modifies the driver to support standard gpio properties along
with deprecated properties. This will help us upstream and cleanup the
non-standard properties over the time.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 8145362..e918889 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -339,19 +339,34 @@ static const struct of_device_id dt_match[] = {
 };
 
 #ifdef CONFIG_OF
+/* This code will be removed once we move to gpiod based calls */
 static int get_gpio(struct device *dev, struct device_node *of_node, const char *name)
 {
+	char name2[32];
 	int gpio = of_get_named_gpio(of_node, name, 0);
-	if (gpio < 0) {
-		char name2[32];
-		snprintf(name2, sizeof(name2), "%s-gpio", name);
-		gpio = of_get_named_gpio(of_node, name2, 0);
-		if (gpio < 0) {
-			dev_err(dev, "failed to get gpio: %s (%d)\n",
-					name, gpio);
-			gpio = -1;
-		}
-	}
+
+	if (gpio_is_valid(gpio))
+		goto deprecated;
+
+	snprintf(name2, sizeof(name2), "%s-gpio", name);
+	gpio = of_get_named_gpio(of_node, name2, 0);
+
+	if (gpio_is_valid(gpio))
+		goto deprecated;
+
+
+	snprintf(name2, sizeof(name2), "%s-gpios", name);
+	gpio = of_get_named_gpio(of_node, name2, 0);
+
+	if (gpio_is_valid(gpio))
+		return gpio;
+
+	dev_err(dev, "failed to get gpio: %s (%d)\n", name, gpio);
+
+	return -1;
+
+deprecated:
+	dev_warn(dev, "binding deprecated for %s\n", name);
 	return gpio;
 }
 #endif
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ