Commit ba22a977 authored by Alex Elder's avatar Alex Elder Committed by Jakub Kicinski

net: ipa: use bulk operations to set up interconnects

Use of_icc_bulk_get() and icc_bulk_put(), icc_bulk_set_bw(), and
icc_bulk_enable() and icc_bulk_disable() to initialize individual
IPA interconnects.  Those functions already log messages in the
event of error so we don't need to.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 90078e63
...@@ -74,41 +74,31 @@ static int ipa_interconnect_init_one(struct device *dev, ...@@ -74,41 +74,31 @@ static int ipa_interconnect_init_one(struct device *dev,
struct icc_bulk_data *interconnect, struct icc_bulk_data *interconnect,
const struct ipa_interconnect_data *data) const struct ipa_interconnect_data *data)
{ {
struct icc_path *path;
int ret; int ret;
path = of_icc_get(dev, data->name); /* interconnect->path is filled in by of_icc_bulk_get() */
if (IS_ERR(path)) { interconnect->name = data->name;
ret = PTR_ERR(path); interconnect->avg_bw = data->average_bandwidth;
dev_err_probe(dev, ret, "error getting %s interconnect\n", interconnect->peak_bw = data->peak_bandwidth;
data->name);
ret = of_icc_bulk_get(dev, 1, interconnect);
if (ret)
return ret; return ret;
}
/* All interconnects are initially disabled */ /* All interconnects are initially disabled */
(void)icc_disable(path); icc_bulk_disable(1, interconnect);
/* Set the bandwidth values to be used when enabled */ /* Set the bandwidth values to be used when enabled */
ret = icc_set_bw(path, data->average_bandwidth, data->peak_bandwidth); ret = icc_bulk_set_bw(1, interconnect);
if (ret) { if (ret)
dev_err(dev, "error %d setting %s interconnect bandwidths\n", icc_bulk_put(1, interconnect);
ret, data->name);
return ret; return ret;
}
interconnect->path = path;
interconnect->name = data->name;
interconnect->avg_bw = data->average_bandwidth;
interconnect->peak_bw = data->peak_bandwidth;
return 0;
} }
static void ipa_interconnect_exit_one(struct icc_bulk_data *interconnect) static void ipa_interconnect_exit_one(struct icc_bulk_data *interconnect)
{ {
icc_put(interconnect->path); icc_bulk_put(1, interconnect);
memset(interconnect, 0, sizeof(*interconnect)); memset(interconnect, 0, sizeof(*interconnect));
} }
......
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