Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: efm32: correct namespacing of location property

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: Mark Brown <broonie@linaro.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
10ed7e98 7171511e

+14 -7
+7 -6
Documentation/devicetree/bindings/spi/efm32-spi.txt
··· 10 10 - cs-gpios: see spi-bus.txt 11 11 12 12 Recommended properties : 13 - - efm32,location: Value to write to the ROUTE register's LOCATION bitfield to 14 - configure the pinmux for the device, see datasheet for values. 15 - If "efm32,location" property is not provided, keeping what is 16 - already configured in the hardware, so its either the reset 17 - default 0 or whatever the bootloader did. 13 + - energymicro,location: Value to write to the ROUTE register's LOCATION 14 + bitfield to configure the pinmux for the device, see 15 + datasheet for values. 16 + If this property is not provided, keeping what is 17 + already configured in the hardware, so its either the 18 + reset default 0 or whatever the bootloader did. 18 19 19 20 Example: 20 21 ··· 27 26 interrupts = <15 16>; 28 27 clocks = <&cmu 20>; 29 28 cs-gpios = <&gpio 51 1>; // D3 30 - efm32,location = <1>; 29 + energymicro,location = <1>; 31 30 status = "ok"; 32 31 33 32 ks8851@0 {
+7 -1
drivers/spi/spi-efm32.c
··· 294 294 u32 location; 295 295 int ret; 296 296 297 - ret = of_property_read_u32(np, "efm32,location", &location); 297 + ret = of_property_read_u32(np, "energymicro,location", &location); 298 + 299 + if (ret) 300 + /* fall back to wrongly namespaced property */ 301 + ret = of_property_read_u32(np, "efm32,location", &location); 302 + 298 303 if (ret) 299 304 /* fall back to old and (wrongly) generic property "location" */ 300 305 ret = of_property_read_u32(np, "location", &location); 306 + 301 307 if (!ret) { 302 308 dev_dbg(&pdev->dev, "using location %u\n", location); 303 309 } else {