提交 4323ec25 编写于 作者: S Srinivas Kandagatla 提交者: Mark Brown

ASoC: codecs: msm8916-wcd-analog: clean parse_dt()

Move the code which is not parsing dt from pm8916_wcd_analog_parse_dt()
to make it clear to reader.

No functional changes done.
Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 4314f928
...@@ -802,7 +802,6 @@ static struct snd_soc_codec_driver pm8916_wcd_analog = { ...@@ -802,7 +802,6 @@ static struct snd_soc_codec_driver pm8916_wcd_analog = {
static int pm8916_wcd_analog_parse_dt(struct device *dev, static int pm8916_wcd_analog_parse_dt(struct device *dev,
struct pm8916_wcd_analog_priv *priv) struct pm8916_wcd_analog_priv *priv)
{ {
int ret, i;
if (of_property_read_bool(dev->of_node, "qcom,micbias1-ext-cap")) if (of_property_read_bool(dev->of_node, "qcom,micbias1-ext-cap"))
priv->micbias1_cap_mode = MICB_1_EN_EXT_BYP_CAP; priv->micbias1_cap_mode = MICB_1_EN_EXT_BYP_CAP;
...@@ -814,21 +813,6 @@ static int pm8916_wcd_analog_parse_dt(struct device *dev, ...@@ -814,21 +813,6 @@ static int pm8916_wcd_analog_parse_dt(struct device *dev,
else else
priv->micbias2_cap_mode = MICB_1_EN_NO_EXT_BYP_CAP; priv->micbias2_cap_mode = MICB_1_EN_NO_EXT_BYP_CAP;
priv->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(priv->mclk)) {
dev_err(dev, "failed to get mclk\n");
return PTR_ERR(priv->mclk);
}
for (i = 0; i < ARRAY_SIZE(supply_names); i++)
priv->supplies[i].supply = supply_names[i];
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies),
priv->supplies);
if (ret) {
dev_err(dev, "Failed to get regulator supplies %d\n", ret);
return ret;
}
return 0; return 0;
} }
...@@ -836,7 +820,7 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) ...@@ -836,7 +820,7 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
{ {
struct pm8916_wcd_analog_priv *priv; struct pm8916_wcd_analog_priv *priv;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int ret; int ret, i;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -846,6 +830,22 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) ...@@ -846,6 +830,22 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
return ret; return ret;
priv->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(priv->mclk)) {
dev_err(dev, "failed to get mclk\n");
return PTR_ERR(priv->mclk);
}
for (i = 0; i < ARRAY_SIZE(supply_names); i++)
priv->supplies[i].supply = supply_names[i];
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies),
priv->supplies);
if (ret) {
dev_err(dev, "Failed to get regulator supplies %d\n", ret);
return ret;
}
ret = clk_prepare_enable(priv->mclk); ret = clk_prepare_enable(priv->mclk);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "failed to enable mclk %d\n", ret); dev_err(dev, "failed to enable mclk %d\n", ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册