Skip to content

Commit adf4611

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: fsl_mqs: Don't check clock is NULL before calling clk API
Because clk_prepare_enable and clk_disable_unprepare should check input clock parameter is NULL or not internally, then we don't need to check them before calling the function. Fixes: 9e28f65 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Shengjiu Wang <[email protected]> Acked-by: Nicolin Chen <[email protected]> Link: https://lore.kernel.org/r/743be216bd504c26e8d45d5ce4a84561b67a122b.1592888591.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <[email protected]>
1 parent f141a42 commit adf4611

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

sound/soc/fsl/fsl_mqs.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,9 @@ static int fsl_mqs_runtime_resume(struct device *dev)
266266
{
267267
struct fsl_mqs *mqs_priv = dev_get_drvdata(dev);
268268

269-
if (mqs_priv->ipg)
270-
clk_prepare_enable(mqs_priv->ipg);
269+
clk_prepare_enable(mqs_priv->ipg);
271270

272-
if (mqs_priv->mclk)
273-
clk_prepare_enable(mqs_priv->mclk);
271+
clk_prepare_enable(mqs_priv->mclk);
274272

275273
if (mqs_priv->use_gpr)
276274
regmap_write(mqs_priv->regmap, IOMUXC_GPR2,
@@ -292,11 +290,8 @@ static int fsl_mqs_runtime_suspend(struct device *dev)
292290
regmap_read(mqs_priv->regmap, REG_MQS_CTRL,
293291
&mqs_priv->reg_mqs_ctrl);
294292

295-
if (mqs_priv->mclk)
296-
clk_disable_unprepare(mqs_priv->mclk);
297-
298-
if (mqs_priv->ipg)
299-
clk_disable_unprepare(mqs_priv->ipg);
293+
clk_disable_unprepare(mqs_priv->mclk);
294+
clk_disable_unprepare(mqs_priv->ipg);
300295

301296
return 0;
302297
}

0 commit comments

Comments
 (0)