linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: linux-gpio@vger.kernel.org
Cc: kernel@pengutronix.de
Subject: of_get_named_gpio on non-dt systems
Date: Fri, 29 Jul 2016 21:05:31 +0200	[thread overview]
Message-ID: <20160729190531.GD17874@pengutronix.de> (raw)

Hello,

I have a non-dt i.MX35 system here using 4.6.4-rt and it oopses when the
i2c-imx driver is loaded. That happes because i2c_imx_init_recovery_info calls:

	rinfo->sda_gpio = of_get_named_gpio(pdev->dev.of_node, "sda-gpios", 0);

with pdev->dev.of_node == NULL. In this end this stumbles over:

	pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n",
		 __func__, propname, np->full_name, index);

in of_get_named_gpiod_flags() because np == pdev->dev.of_node.

For now I disabled CONFIG_DEBUG_GPIO but this obviously isn't the right
fix.

My question now is: is it allowed to call of_get_named_gpio with
np=NULL? Depending on the answer to this question either i2c-imx or
of_get_named_gpiod_flags should be fixed.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2016-07-29 19:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160729190531.GD17874@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-gpio@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).