Skip to content

Commit 9330bf7

Browse files
author
Georgi Djakov
committed
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: Georgi Djakov <djakov@kernel.org>
2 parents bd35cbd + 4d8784d commit 9330bf7

5 files changed

Lines changed: 23 additions & 8 deletions

File tree

Documentation/devicetree/bindings/interconnect/qcom,rpmh.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ allOf:
113113
properties:
114114
compatible:
115115
enum:
116+
- qcom,sdx65-mc-virt
116117
- qcom,sm8250-qup-virt
117118
then:
118119
required:

drivers/interconnect/imx/imx.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
#ifndef __DRIVERS_INTERCONNECT_IMX_H
1111
#define __DRIVERS_INTERCONNECT_IMX_H
1212

13+
#include <linux/args.h>
14+
#include <linux/bits.h>
15+
#include <linux/types.h>
16+
1317
#include <linux/interconnect-provider.h>
14-
#include <linux/kernel.h>
18+
19+
struct platform_device;
1520

1621
#define IMX_ICC_MAX_LINKS 4
1722

@@ -89,7 +94,7 @@ struct imx_icc_noc_setting {
8994
.id = _id, \
9095
.name = _name, \
9196
.adj = _adj, \
92-
.num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \
97+
.num_links = COUNT_ARGS(__VA_ARGS__), \
9398
.links = { __VA_ARGS__ }, \
9499
}
95100

drivers/interconnect/qcom/icc-rpm.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ int qnoc_probe(struct platform_device *pdev)
543543

544544
ret = devm_clk_bulk_get(dev, qp->num_intf_clks, qp->intf_clks);
545545
if (ret)
546-
return ret;
546+
goto err_disable_unprepare_clk;
547547

548548
provider = &qp->provider;
549549
provider->dev = dev;
@@ -558,7 +558,7 @@ int qnoc_probe(struct platform_device *pdev)
558558
/* If this fails, bus accesses will crash the platform! */
559559
ret = clk_bulk_prepare_enable(qp->num_intf_clks, qp->intf_clks);
560560
if (ret)
561-
return ret;
561+
goto err_disable_unprepare_clk;
562562

563563
for (i = 0; i < num_nodes; i++) {
564564
size_t j;
@@ -571,6 +571,8 @@ int qnoc_probe(struct platform_device *pdev)
571571

572572
node = icc_node_create(qnodes[i]->id);
573573
if (IS_ERR(node)) {
574+
clk_bulk_disable_unprepare(qp->num_intf_clks,
575+
qp->intf_clks);
574576
ret = PTR_ERR(node);
575577
goto err_remove_nodes;
576578
}
@@ -586,8 +588,11 @@ int qnoc_probe(struct platform_device *pdev)
586588
if (qnodes[i]->qos.ap_owned &&
587589
qnodes[i]->qos.qos_mode != NOC_QOS_MODE_INVALID) {
588590
ret = qcom_icc_qos_set(node);
589-
if (ret)
590-
return ret;
591+
if (ret) {
592+
clk_bulk_disable_unprepare(qp->num_intf_clks,
593+
qp->intf_clks);
594+
goto err_remove_nodes;
595+
}
591596
}
592597

593598
data->nodes[i] = node;
@@ -615,6 +620,7 @@ int qnoc_probe(struct platform_device *pdev)
615620
icc_provider_deregister(provider);
616621
err_remove_nodes:
617622
icc_nodes_remove(provider);
623+
err_disable_unprepare_clk:
618624
clk_disable_unprepare(qp->bus_clk);
619625

620626
return ret;

drivers/interconnect/qcom/msm8974.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
*/
2929

3030
#include <dt-bindings/interconnect/qcom,msm8974.h>
31+
32+
#include <linux/args.h>
3133
#include <linux/clk.h>
3234
#include <linux/device.h>
3335
#include <linux/interconnect-provider.h>
@@ -231,7 +233,7 @@ struct msm8974_icc_desc {
231233
.buswidth = _buswidth, \
232234
.mas_rpm_id = _mas_rpm_id, \
233235
.slv_rpm_id = _slv_rpm_id, \
234-
.num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \
236+
.num_links = COUNT_ARGS(__VA_ARGS__), \
235237
.links = { __VA_ARGS__ }, \
236238
}
237239

drivers/interconnect/qcom/osm-l3.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
44
*/
55

6+
#include <linux/args.h>
67
#include <linux/bitfield.h>
78
#include <linux/clk.h>
89
#include <linux/interconnect-provider.h>
@@ -78,7 +79,7 @@ enum {
7879
.name = #_name, \
7980
.id = _id, \
8081
.buswidth = _buswidth, \
81-
.num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \
82+
.num_links = COUNT_ARGS(__VA_ARGS__), \
8283
.links = { __VA_ARGS__ }, \
8384
}
8485

0 commit comments

Comments
 (0)