Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8d6dc78 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

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
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -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);
}

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);
	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
					   clk_data);
}

static const struct scmi_device_id scmi_id_table[] = {
@@ -192,7 +185,6 @@ MODULE_DEVICE_TABLE(scmi, scmi_id_table);
static struct scmi_driver scmi_clocks_driver = {
	.name = "scmi-clocks",
	.probe = scmi_clocks_probe,
	.remove = scmi_clocks_remove,
	.id_table = scmi_id_table,
};
module_scmi_driver(scmi_clocks_driver);
+3 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
{
	u64 *rate;
	int ret, cnt;
	bool rate_discrete;
	bool rate_discrete = false;
	u32 tot_rate_cnt = 0, rates_flag;
	u16 num_returned, num_remaining;
	struct scmi_xfer *t;
@@ -147,7 +147,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,

		ret = scmi_do_xfer(handle, t);
		if (ret)
			break;
			goto err;

		rates_flag = le32_to_cpu(rlist->num_rates_flags);
		num_remaining = NUM_REMAINING(rates_flag);
@@ -185,6 +185,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
	if (rate_discrete)
		clk->list.num_rates = tot_rate_cnt;

err:
	scmi_one_xfer_put(handle, t);
	return ret;
}
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
	for (i = 0; i < nr_sensors; i++) {
		sensor = handle->sensor_ops->info_get(handle, i);
		if (!sensor)
			return PTR_ERR(sensor);
			return -EINVAL;

		switch (sensor->type) {
		case TEMPERATURE_C: