diff mbox

spi: efm32: properly namespace location property

Message ID 1394812888-22697-1-git-send-email-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Uwe Kleine-König March 14, 2014, 4:01 p.m. UTC
While reviewing an i2c driver for efm32 that needs a similar property
Wolfram Sang pointed out that "location" is a too generic name for something
that is efm32 specific. So add an appropriate namespace and fall back to the
generic name in case of failure.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-efm32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Mark Brown March 14, 2014, 4:10 p.m. UTC | #1
On Fri, Mar 14, 2014 at 05:01:28PM +0100, Uwe Kleine-König wrote:
> While reviewing an i2c driver for efm32 that needs a similar property
> Wolfram Sang pointed out that "location" is a too generic name for something
> that is efm32 specific. So add an appropriate namespace and fall back to the
> generic name in case of failure.

The binding needs an update too...
Mark Brown March 14, 2014, 7:27 p.m. UTC | #2
On Fri, Mar 14, 2014 at 05:01:28PM +0100, Uwe Kleine-König wrote:
> While reviewing an i2c driver for efm32 that needs a similar property
> Wolfram Sang pointed out that "location" is a too generic name for something
> that is efm32 specific. So add an appropriate namespace and fall back to the
> generic name in case of failure.

This doesn't apply against current code (I expect due to the non-DT
cleanup from Axel) and like I said earlier needs a binding update.  It
does make sense - can you respin against my topic/efm32 please?
diff mbox

Patch

diff --git a/drivers/spi/spi-efm32.c b/drivers/spi/spi-efm32.c
index d4d3cc534792..daa73358f92d 100644
--- a/drivers/spi/spi-efm32.c
+++ b/drivers/spi/spi-efm32.c
@@ -297,7 +297,10 @@  static int efm32_spi_probe_dt(struct platform_device *pdev,
 	if (!np)
 		return 1;
 
-	ret = of_property_read_u32(np, "location", &location);
+	ret = of_property_read_u32(np, "efm32,location", &location);
+	if (ret)
+		/* fall back to old and (wrongly) generic property "location" */
+		ret = of_property_read_u32(np, "location", &location);
 	if (!ret) {
 		dev_dbg(&pdev->dev, "using location %u\n", location);
 	} else {