mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] pinctrl: at91: Bail out if atmel, pins property does not exist
@ 2017-06-27  9:23 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2017-06-27  9:23 UTC (permalink / raw)
  To: Barebox List

Do not blindly assume that a device node has a atmel,pins property.
Instead, test it for being NULL before using it. This also silences
a compiler warning when the driver is compiled without OF support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/pinctrl/pinctrl-at91.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 021c1e5a2e..d52c184e44 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -449,6 +449,9 @@ static int at91_pinctrl_set_state(struct pinctrl_device *pdev, struct device_nod
 	info = to_at91_pinctrl(pdev);
 
 	list = of_get_property(np, "atmel,pins", &size);
+	if (!list)
+		return -EINVAL;
+
 	size /= sizeof(*list);
 
 	if (!size || size % 4) {
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-27  9:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27  9:23 [PATCH] pinctrl: at91: Bail out if atmel, pins property does not exist Sascha Hauer

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