Commit 9330bf74 authored by Georgi Djakov's avatar Georgi Djakov

Merge branch 'icc-misc' into icc-next

* icc-misc
  interconnect: imx: Replace custom implementation of COUNT_ARGS()
  interconnect: msm8974: Replace custom implementation of COUNT_ARGS()
  interconnect: qcom: osm-l3: Replace custom implementation of COUNT_ARGS()
  interconnect: fix error handling in qnoc_probe()
  interconnect: imx: Replace inclusion of kernel.h in the header
  dt-bindings: interconnect: qcom,rpmh: do not require reg on SDX65 MC virt
Signed-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
parents bd35cbd7 4d8784d8
...@@ -113,6 +113,7 @@ allOf: ...@@ -113,6 +113,7 @@ allOf:
properties: properties:
compatible: compatible:
enum: enum:
- qcom,sdx65-mc-virt
- qcom,sm8250-qup-virt - qcom,sm8250-qup-virt
then: then:
required: required:
......
...@@ -10,8 +10,13 @@ ...@@ -10,8 +10,13 @@
#ifndef __DRIVERS_INTERCONNECT_IMX_H #ifndef __DRIVERS_INTERCONNECT_IMX_H
#define __DRIVERS_INTERCONNECT_IMX_H #define __DRIVERS_INTERCONNECT_IMX_H
#include <linux/args.h>
#include <linux/bits.h>
#include <linux/types.h>
#include <linux/interconnect-provider.h> #include <linux/interconnect-provider.h>
#include <linux/kernel.h>
struct platform_device;
#define IMX_ICC_MAX_LINKS 4 #define IMX_ICC_MAX_LINKS 4
...@@ -89,7 +94,7 @@ struct imx_icc_noc_setting { ...@@ -89,7 +94,7 @@ struct imx_icc_noc_setting {
.id = _id, \ .id = _id, \
.name = _name, \ .name = _name, \
.adj = _adj, \ .adj = _adj, \
.num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \ .num_links = COUNT_ARGS(__VA_ARGS__), \
.links = { __VA_ARGS__ }, \ .links = { __VA_ARGS__ }, \
} }
......
...@@ -543,7 +543,7 @@ int qnoc_probe(struct platform_device *pdev) ...@@ -543,7 +543,7 @@ int qnoc_probe(struct platform_device *pdev)
ret = devm_clk_bulk_get(dev, qp->num_intf_clks, qp->intf_clks); ret = devm_clk_bulk_get(dev, qp->num_intf_clks, qp->intf_clks);
if (ret) if (ret)
return ret; goto err_disable_unprepare_clk;
provider = &qp->provider; provider = &qp->provider;
provider->dev = dev; provider->dev = dev;
...@@ -558,7 +558,7 @@ int qnoc_probe(struct platform_device *pdev) ...@@ -558,7 +558,7 @@ int qnoc_probe(struct platform_device *pdev)
/* If this fails, bus accesses will crash the platform! */ /* If this fails, bus accesses will crash the platform! */
ret = clk_bulk_prepare_enable(qp->num_intf_clks, qp->intf_clks); ret = clk_bulk_prepare_enable(qp->num_intf_clks, qp->intf_clks);
if (ret) if (ret)
return ret; goto err_disable_unprepare_clk;
for (i = 0; i < num_nodes; i++) { for (i = 0; i < num_nodes; i++) {
size_t j; size_t j;
...@@ -571,6 +571,8 @@ int qnoc_probe(struct platform_device *pdev) ...@@ -571,6 +571,8 @@ int qnoc_probe(struct platform_device *pdev)
node = icc_node_create(qnodes[i]->id); node = icc_node_create(qnodes[i]->id);
if (IS_ERR(node)) { if (IS_ERR(node)) {
clk_bulk_disable_unprepare(qp->num_intf_clks,
qp->intf_clks);
ret = PTR_ERR(node); ret = PTR_ERR(node);
goto err_remove_nodes; goto err_remove_nodes;
} }
...@@ -586,8 +588,11 @@ int qnoc_probe(struct platform_device *pdev) ...@@ -586,8 +588,11 @@ int qnoc_probe(struct platform_device *pdev)
if (qnodes[i]->qos.ap_owned && if (qnodes[i]->qos.ap_owned &&
qnodes[i]->qos.qos_mode != NOC_QOS_MODE_INVALID) { qnodes[i]->qos.qos_mode != NOC_QOS_MODE_INVALID) {
ret = qcom_icc_qos_set(node); ret = qcom_icc_qos_set(node);
if (ret) if (ret) {
return ret; clk_bulk_disable_unprepare(qp->num_intf_clks,
qp->intf_clks);
goto err_remove_nodes;
}
} }
data->nodes[i] = node; data->nodes[i] = node;
...@@ -615,6 +620,7 @@ int qnoc_probe(struct platform_device *pdev) ...@@ -615,6 +620,7 @@ int qnoc_probe(struct platform_device *pdev)
icc_provider_deregister(provider); icc_provider_deregister(provider);
err_remove_nodes: err_remove_nodes:
icc_nodes_remove(provider); icc_nodes_remove(provider);
err_disable_unprepare_clk:
clk_disable_unprepare(qp->bus_clk); clk_disable_unprepare(qp->bus_clk);
return ret; return ret;
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
*/ */
#include <dt-bindings/interconnect/qcom,msm8974.h> #include <dt-bindings/interconnect/qcom,msm8974.h>
#include <linux/args.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/interconnect-provider.h> #include <linux/interconnect-provider.h>
...@@ -231,7 +233,7 @@ struct msm8974_icc_desc { ...@@ -231,7 +233,7 @@ struct msm8974_icc_desc {
.buswidth = _buswidth, \ .buswidth = _buswidth, \
.mas_rpm_id = _mas_rpm_id, \ .mas_rpm_id = _mas_rpm_id, \
.slv_rpm_id = _slv_rpm_id, \ .slv_rpm_id = _slv_rpm_id, \
.num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \ .num_links = COUNT_ARGS(__VA_ARGS__), \
.links = { __VA_ARGS__ }, \ .links = { __VA_ARGS__ }, \
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/args.h>
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/interconnect-provider.h> #include <linux/interconnect-provider.h>
...@@ -78,7 +79,7 @@ enum { ...@@ -78,7 +79,7 @@ enum {
.name = #_name, \ .name = #_name, \
.id = _id, \ .id = _id, \
.buswidth = _buswidth, \ .buswidth = _buswidth, \
.num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \ .num_links = COUNT_ARGS(__VA_ARGS__), \
.links = { __VA_ARGS__ }, \ .links = { __VA_ARGS__ }, \
} }
......
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