Commit 14bd7b9c authored by Jerome Brunet's avatar Jerome Brunet Committed by Neil Armstrong

clk: meson: only one loop index is necessary in probe

We don't need several loop index variables in the probe function
This is far from being critical but since we are doing a vast
rework of meson clock controllers, now is the time to lower the
entropy a bit
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
parent 332b32a2
...@@ -802,7 +802,7 @@ static int axg_clkc_probe(struct platform_device *pdev) ...@@ -802,7 +802,7 @@ static int axg_clkc_probe(struct platform_device *pdev)
const struct clkc_data *clkc_data; const struct clkc_data *clkc_data;
struct resource *res; struct resource *res;
void __iomem *clk_base; void __iomem *clk_base;
int ret, clkid, i; int ret, i;
clkc_data = of_device_get_match_data(dev); clkc_data = of_device_get_match_data(dev);
if (!clkc_data) if (!clkc_data)
...@@ -841,13 +841,13 @@ static int axg_clkc_probe(struct platform_device *pdev) ...@@ -841,13 +841,13 @@ static int axg_clkc_probe(struct platform_device *pdev)
clkc_data->clk_dividers[i]->reg = clk_base + clkc_data->clk_dividers[i]->reg = clk_base +
(u64)clkc_data->clk_dividers[i]->reg; (u64)clkc_data->clk_dividers[i]->reg;
for (clkid = 0; clkid < clkc_data->hw_onecell_data->num; clkid++) { for (i = 0; i < clkc_data->hw_onecell_data->num; i++) {
/* array might be sparse */ /* array might be sparse */
if (!clkc_data->hw_onecell_data->hws[clkid]) if (!clkc_data->hw_onecell_data->hws[i])
continue; continue;
ret = devm_clk_hw_register(dev, ret = devm_clk_hw_register(dev,
clkc_data->hw_onecell_data->hws[clkid]); clkc_data->hw_onecell_data->hws[i]);
if (ret) { if (ret) {
dev_err(dev, "Clock registration failed\n"); dev_err(dev, "Clock registration failed\n");
return ret; return ret;
......
...@@ -1947,7 +1947,7 @@ static int gxbb_clkc_probe(struct platform_device *pdev) ...@@ -1947,7 +1947,7 @@ static int gxbb_clkc_probe(struct platform_device *pdev)
{ {
const struct clkc_data *clkc_data; const struct clkc_data *clkc_data;
void __iomem *clk_base; void __iomem *clk_base;
int ret, clkid, i; int ret, i;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
clkc_data = of_device_get_match_data(dev); clkc_data = of_device_get_match_data(dev);
...@@ -1988,16 +1988,15 @@ static int gxbb_clkc_probe(struct platform_device *pdev) ...@@ -1988,16 +1988,15 @@ static int gxbb_clkc_probe(struct platform_device *pdev)
for (i = 0; i < clkc_data->clk_audio_dividers_count; i++) for (i = 0; i < clkc_data->clk_audio_dividers_count; i++)
clkc_data->clk_audio_dividers[i]->base = clk_base; clkc_data->clk_audio_dividers[i]->base = clk_base;
/*
* register all clks /* Register all clks */
*/ for (i = 0; i < clkc_data->hw_onecell_data->num; i++) {
for (clkid = 0; clkid < clkc_data->hw_onecell_data->num; clkid++) {
/* array might be sparse */ /* array might be sparse */
if (!clkc_data->hw_onecell_data->hws[clkid]) if (!clkc_data->hw_onecell_data->hws[i])
continue; continue;
ret = devm_clk_hw_register(dev, ret = devm_clk_hw_register(dev,
clkc_data->hw_onecell_data->hws[clkid]); clkc_data->hw_onecell_data->hws[i]);
if (ret) if (ret)
goto iounmap; goto iounmap;
} }
......
...@@ -806,7 +806,7 @@ static const struct reset_control_ops meson8b_clk_reset_ops = { ...@@ -806,7 +806,7 @@ static const struct reset_control_ops meson8b_clk_reset_ops = {
static int meson8b_clkc_probe(struct platform_device *pdev) static int meson8b_clkc_probe(struct platform_device *pdev)
{ {
int ret, clkid, i; int ret, i;
struct clk_hw *parent_hw; struct clk_hw *parent_hw;
struct clk *parent_clk; struct clk *parent_clk;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -844,13 +844,13 @@ static int meson8b_clkc_probe(struct platform_device *pdev) ...@@ -844,13 +844,13 @@ static int meson8b_clkc_probe(struct platform_device *pdev)
* register all clks * register all clks
* CLKID_UNUSED = 0, so skip it and start with CLKID_XTAL = 1 * CLKID_UNUSED = 0, so skip it and start with CLKID_XTAL = 1
*/ */
for (clkid = CLKID_XTAL; clkid < CLK_NR_CLKS; clkid++) { for (i = CLKID_XTAL; i < CLK_NR_CLKS; i++) {
/* array might be sparse */ /* array might be sparse */
if (!meson8b_hw_onecell_data.hws[clkid]) if (!meson8b_hw_onecell_data.hws[i])
continue; continue;
/* FIXME convert to devm_clk_register */ /* FIXME convert to devm_clk_register */
ret = devm_clk_hw_register(dev, meson8b_hw_onecell_data.hws[clkid]); ret = devm_clk_hw_register(dev, meson8b_hw_onecell_data.hws[i]);
if (ret) if (ret)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment