Skip to content

Commit

Permalink
serial: efm32: properly namespace location property
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Mar 17, 2014
1 parent 58dea35 commit 74be65a
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/serial/efm32-uart.txt
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ Required properties:
- interrupts : Should contain uart interrupt

Optional properties:
- location : Decides the location of the USART I/O pins.
- efm32,location : Decides the location of the USART I/O pins.
Allowed range : [0 .. 5]
Default: 0

@@ -16,5 +16,5 @@ uart@0x4000c400 {
compatible = "efm32,uart";
reg = <0x4000c400 0x400>;
interrupts = <15>;
location = <0>;
efm32,location = <0>;
};
5 changes: 4 additions & 1 deletion drivers/tty/serial/efm32-uart.c
Original file line number Diff line number Diff line change
@@ -671,7 +671,10 @@ static int efm32_uart_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) {
if (location > 5) {
dev_err(&pdev->dev, "invalid location\n");

0 comments on commit 74be65a

Please sign in to comment.