Commit f8d6dc78 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'scmi-fixes-4.17' of...

Merge tag 'scmi-fixes-4.17' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/drivers

Pull "ARM SCMI fixes/cleanups for v4.17" from Sudeep Holla:

Couple of fixes for build warning due to uninitialised variable
and static checker warning for passing NULL pointer to PTR_ERR.
It also contains cleanup suggested by Stephen Boyd in SCMI clock
driver using the new devm_of_clk_add_hw_provider() API.

* tag 'scmi-fixes-4.17' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  clk: scmi: use devm_of_clk_add_hw_provider() API and drop scmi_clocks_remove
  firmware: arm_scmi: prevent accessing rate_discrete uninitialized
  hwmon: (scmi) return -EINVAL when sensor information is unavailable
parents b701b41b 7f9badfc
...@@ -172,15 +172,8 @@ static int scmi_clocks_probe(struct scmi_device *sdev) ...@@ -172,15 +172,8 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
} }
} }
return of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
} clk_data);
static void scmi_clocks_remove(struct scmi_device *sdev)
{
struct device *dev = &sdev->dev;
struct device_node *np = dev->of_node;
of_clk_del_provider(np);
} }
static const struct scmi_device_id scmi_id_table[] = { static const struct scmi_device_id scmi_id_table[] = {
...@@ -192,7 +185,6 @@ MODULE_DEVICE_TABLE(scmi, scmi_id_table); ...@@ -192,7 +185,6 @@ MODULE_DEVICE_TABLE(scmi, scmi_id_table);
static struct scmi_driver scmi_clocks_driver = { static struct scmi_driver scmi_clocks_driver = {
.name = "scmi-clocks", .name = "scmi-clocks",
.probe = scmi_clocks_probe, .probe = scmi_clocks_probe,
.remove = scmi_clocks_remove,
.id_table = scmi_id_table, .id_table = scmi_id_table,
}; };
module_scmi_driver(scmi_clocks_driver); module_scmi_driver(scmi_clocks_driver);
......
...@@ -125,7 +125,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, ...@@ -125,7 +125,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
{ {
u64 *rate; u64 *rate;
int ret, cnt; int ret, cnt;
bool rate_discrete; bool rate_discrete = false;
u32 tot_rate_cnt = 0, rates_flag; u32 tot_rate_cnt = 0, rates_flag;
u16 num_returned, num_remaining; u16 num_returned, num_remaining;
struct scmi_xfer *t; struct scmi_xfer *t;
...@@ -147,7 +147,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, ...@@ -147,7 +147,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
ret = scmi_do_xfer(handle, t); ret = scmi_do_xfer(handle, t);
if (ret) if (ret)
break; goto err;
rates_flag = le32_to_cpu(rlist->num_rates_flags); rates_flag = le32_to_cpu(rlist->num_rates_flags);
num_remaining = NUM_REMAINING(rates_flag); num_remaining = NUM_REMAINING(rates_flag);
...@@ -185,6 +185,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, ...@@ -185,6 +185,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
if (rate_discrete) if (rate_discrete)
clk->list.num_rates = tot_rate_cnt; clk->list.num_rates = tot_rate_cnt;
err:
scmi_one_xfer_put(handle, t); scmi_one_xfer_put(handle, t);
return ret; return ret;
} }
......
...@@ -138,7 +138,7 @@ static int scmi_hwmon_probe(struct scmi_device *sdev) ...@@ -138,7 +138,7 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
for (i = 0; i < nr_sensors; i++) { for (i = 0; i < nr_sensors; i++) {
sensor = handle->sensor_ops->info_get(handle, i); sensor = handle->sensor_ops->info_get(handle, i);
if (!sensor) if (!sensor)
return PTR_ERR(sensor); return -EINVAL;
switch (sensor->type) { switch (sensor->type) {
case TEMPERATURE_C: case TEMPERATURE_C:
......
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