Skip to content

Commit

Permalink
i2c: efm32: correct namespacing of location property
Browse files Browse the repository at this point in the history
Olof Johansson pointed out that usually the company name is picked as
namespace prefix to specific properties. So expect "energymicro,location"
but fall back to the previously introduced name "efm32,location".

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Uwe Kleine-König authored and Wolfram Sang committed Jul 17, 2014
1 parent 290025d commit 281ec36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/i2c/i2c-efm32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Required properties :
Recommended properties :

- clock-frequency : maximal I2C bus clock frequency in Hz.
- efm32,location : Decides the location of the USART I/O pins.
- energymicro,location : Decides the location of the USART I/O pins.
Allowed range : [0 .. 6]

Example:
Expand All @@ -23,7 +23,7 @@ Example:
clocks = <&cmu clk_HFPERCLKI2C0>;
clock-frequency = <100000>;
status = "ok";
efm32,location = <3>;
energymicro,location = <3>;

eeprom@50 {
compatible = "microchip,24c02";
Expand Down
8 changes: 7 additions & 1 deletion drivers/i2c/busses/i2c-efm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,13 @@ static int efm32_i2c_probe(struct platform_device *pdev)
return ret;
}

ret = of_property_read_u32(np, "efm32,location", &location);

ret = of_property_read_u32(np, "energymicro,location", &location);

if (ret)
/* fall back to wrongly namespaced property */
ret = of_property_read_u32(np, "efm32,location", &location);

if (!ret) {
dev_dbg(&pdev->dev, "using location %u\n", location);
} else {
Expand Down

0 comments on commit 281ec36

Please sign in to comment.