Merge branch 'fix/rcar' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[muen/linux.git] / sound / soc / sh / rcar / adg.c
index 54146f66538c18ba87cfe4a0e4e3c68fb3d880d9..214a9ce90bb41608100fbd1dd1da82792487151a 100644 (file)
@@ -537,16 +537,14 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
                        clk = clk_register_fixed_rate(dev, clkout_name[i],
                                                      parent_clk_name, 0,
                                                      req_rate);
-                       if (!IS_ERR(clk)) {
-                               adg->onecell.clks       = adg->clkout;
-                               adg->onecell.clk_num    = CLKOUTMAX;
-
+                       adg->clkout[i] = ERR_PTR(-ENOENT);
+                       if (!IS_ERR(clk))
                                adg->clkout[i] = clk;
-
-                               of_clk_add_provider(np, of_clk_src_onecell_get,
-                                                   &adg->onecell);
-                       }
                }
+               adg->onecell.clks       = adg->clkout;
+               adg->onecell.clk_num    = CLKOUTMAX;
+               of_clk_add_provider(np, of_clk_src_onecell_get,
+                                   &adg->onecell);
        }
 
        adg->ckr = ckr;
@@ -592,5 +590,10 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
 
 void rsnd_adg_remove(struct rsnd_priv *priv)
 {
+       struct device *dev = rsnd_priv_to_dev(priv);
+       struct device_node *np = dev->of_node;
+
+       of_clk_del_provider(np);
+
        rsnd_adg_clk_disable(priv);
 }