clk: Update drivers to use -EINVAL

At present some drivers use -ENOSUPP to indicate that an unknown or
unsupported clock is used. Most use -EINVAL, indicating an invalid value,
so convert everything to that.

Signed-off-by: Simon Glass <sjg@chromium.org>

Acked-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Simon Glass 2021-03-25 10:26:08 +13:00
parent 2f541aa53c
commit 9042bf6fe4
9 changed files with 17 additions and 17 deletions

View File

@ -1140,7 +1140,7 @@ int soc_clk_dump(void)
clk_free(&clk);
if (ret == -ENOTSUPP) {
if (ret == -EINVAL) {
printf("clk ID %lu not supported yet\n",
aspeed_clk_names[i].id);
continue;

View File

@ -718,7 +718,7 @@ static ulong hsdk_cgu_set_rate(struct clk *sclk, ulong rate)
if (clk->map[sclk->id].set_rate)
return clk->map[sclk->id].set_rate(sclk, rate);
return -ENOTSUPP;
return -EINVAL;
}
static int hsdk_cgu_disable(struct clk *sclk)
@ -731,7 +731,7 @@ static int hsdk_cgu_disable(struct clk *sclk)
if (clk->map[sclk->id].disable)
return clk->map[sclk->id].disable(sclk);
return -ENOTSUPP;
return -EINVAL;
}
static const struct clk_ops hsdk_cgu_ops = {

View File

@ -29,7 +29,7 @@ __weak ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate)
__weak int __imx8_clk_enable(struct clk *clk, bool enable)
{
return -ENOTSUPP;
return -EINVAL;
}
static int imx8_clk_disable(struct clk *clk)
@ -70,7 +70,7 @@ int soc_clk_dump(void)
clk_free(&clk);
if (ret == -ENOTSUPP) {
if (ret == -EINVAL) {
printf("clk ID %lu not supported yet\n",
imx8_clk_names[i].id);
continue;

View File

@ -133,7 +133,7 @@ ulong imx8_clk_get_rate(struct clk *clk)
__func__, clk->id);
return -EINVAL;
}
return -ENOTSUPP;
return -EINVAL;
};
ret = sc_pm_get_clock_rate(-1, resource, pm_clk,
@ -237,7 +237,7 @@ ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate)
__func__, clk->id);
return -EINVAL;
}
return -ENOTSUPP;
return -EINVAL;
};
ret = sc_pm_set_clock_rate(-1, resource, pm_clk, &new_rate);
@ -337,7 +337,7 @@ int __imx8_clk_enable(struct clk *clk, bool enable)
__func__, clk->id);
return -EINVAL;
}
return -ENOTSUPP;
return -EINVAL;
}
ret = sc_pm_clock_enable(-1, resource, pm_clk, enable, 0);

View File

@ -126,7 +126,7 @@ ulong imx8_clk_get_rate(struct clk *clk)
__func__, clk->id);
return -EINVAL;
}
return -ENOTSUPP;
return -EINVAL;
};
ret = sc_pm_get_clock_rate(-1, resource, pm_clk,
@ -221,7 +221,7 @@ ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate)
__func__, clk->id);
return -EINVAL;
}
return -ENOTSUPP;
return -EINVAL;
};
ret = sc_pm_set_clock_rate(-1, resource, pm_clk, &new_rate);
@ -311,7 +311,7 @@ int __imx8_clk_enable(struct clk *clk, bool enable)
__func__, clk->id);
return -EINVAL;
}
return -ENOTSUPP;
return -EINVAL;
}
ret = sc_pm_clock_enable(-1, resource, pm_clk, enable, 0);

View File

@ -290,7 +290,7 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
break;
default:
kfree(pll);
return ERR_PTR(-ENOTSUPP);
return ERR_PTR(-EINVAL);
}
pll->base = base;

View File

@ -157,7 +157,7 @@ static int k210_bypass_set_parent(struct clk *clk, struct clk *parent)
if (ops->set_parent)
return ops->set_parent(bypass->bypassee, parent);
else
return -ENOTSUPP;
return -EINVAL;
}
/*

View File

@ -495,7 +495,7 @@ static int k210_clk_probe(struct udevice *dev)
* could fix this, but it's Probably Not Worth It (TM).
*/
if (probed)
return -ENOTSUPP;
return -EINVAL;
base = dev_read_addr_ptr(dev_get_parent(dev));
if (!base)

View File

@ -340,7 +340,7 @@ static int periph_clk_enable(struct clk *clk, int enable)
return -EINVAL;
if (!periph_clk->can_gate)
return -ENOTSUPP;
return -EINVAL;
if (enable)
clrbits_le32(priv->reg + CLK_DIS, periph_clk->disable_bit);
@ -408,7 +408,7 @@ static ulong armada_37xx_periph_clk_set_rate(struct clk *clk, ulong req_rate)
return old_rate;
if (!periph_clk->can_gate || !periph_clk->dividers)
return -ENOTSUPP;
return -EINVAL;
parent_rate = get_parent_rate(priv, clk->id);
if (parent_rate == -EINVAL)
@ -445,7 +445,7 @@ static int armada_37xx_periph_clk_set_parent(struct clk *clk,
return -EINVAL;
if (!periph_clk->can_mux || !periph_clk->can_gate)
return -ENOTSUPP;
return -EINVAL;
ret = clk_get_by_index(clk->dev, 0, &check_parent);
if (ret < 0)