소스 검색

mfd: arizona: Only attempt to parse DT if platform data was not passed

If platform data is passed when probing the device then it should take
precedence over Device Tree. This patch saves cycles in the pdata case
and prevents error messages when DT is not passed.

Reported-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Lee Jones 12 년 전
부모
커밋
22d7dc8aba
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      drivers/mfd/arizona-core.c

+ 2 - 2
drivers/mfd/arizona-core.c

@@ -607,11 +607,11 @@ int arizona_dev_init(struct arizona *arizona)
 	dev_set_drvdata(arizona->dev, arizona);
 	mutex_init(&arizona->clk_lock);
 
-	arizona_of_get_core_pdata(arizona);
-
 	if (dev_get_platdata(arizona->dev))
 		memcpy(&arizona->pdata, dev_get_platdata(arizona->dev),
 		       sizeof(arizona->pdata));
+	else
+		arizona_of_get_core_pdata(arizona);
 
 	regcache_cache_only(arizona->regmap, true);