diff mbox

ASoC: rt5514: The ACPI also should use the function rt5514_parse_dp()

Message ID 1509621676-14608-1-git-send-email-oder_chiou@realtek.com (mailing list archive)
State Accepted
Commit 28aef24d726f8d503fde24ccf8a14b214355cfb5
Headers show

Commit Message

Oder Chiou Nov. 2, 2017, 11:21 a.m. UTC
The patch fixed that the ACPI cannot access the device property from the
function rt5514_parse_dp().

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
---
 sound/soc/codecs/rt5514.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Mark Brown Nov. 2, 2017, 11:30 a.m. UTC | #1
On Thu, Nov 02, 2017 at 07:21:16PM +0800, Oder Chiou wrote:

> -	else if (i2c->dev.of_node)
> -		rt5514_parse_dt(rt5514, &i2c->dev);
> +	else
> +		rt5514_parse_dp(rt5514, &i2c->dev);

Should this be changed to i2c->dev.of_node || ACPI_HANDLE(&i2c->dev) or
will the function cope fine if there are no properties at all?
diff mbox

Patch

diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c
index d7956ab..2a5b5d7 100644
--- a/sound/soc/codecs/rt5514.c
+++ b/sound/soc/codecs/rt5514.c
@@ -1143,7 +1143,7 @@  static const struct acpi_device_id rt5514_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, rt5514_acpi_match);
 #endif
 
-static int rt5514_parse_dt(struct rt5514_priv *rt5514, struct device *dev)
+static int rt5514_parse_dp(struct rt5514_priv *rt5514, struct device *dev)
 {
 	device_property_read_u32(dev, "realtek,dmic-init-delay-ms",
 		&rt5514->pdata.dmic_init_delay);
@@ -1183,8 +1183,8 @@  static int rt5514_i2c_probe(struct i2c_client *i2c,
 
 	if (pdata)
 		rt5514->pdata = *pdata;
-	else if (i2c->dev.of_node)
-		rt5514_parse_dt(rt5514, &i2c->dev);
+	else
+		rt5514_parse_dp(rt5514, &i2c->dev);
 
 	rt5514->i2c_regmap = devm_regmap_init_i2c(i2c, &rt5514_i2c_regmap);
 	if (IS_ERR(rt5514->i2c_regmap)) {