From 60aba820dec333eaa7a320de1403b77e444a178c Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javier@osg.samsung.com>
Date: Mon, 2 Jan 2017 10:02:29 -0300
Subject: bus: arm-ccn: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/bus/arm-ccn.ko | grep alias
$

After this patch:

$ modinfo drivers/bus/arm-ccn.ko | grep alias
alias:          of:N*T*Carm,ccn-504C*
alias:          of:N*T*Carm,ccn-504

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 drivers/bus/arm-ccn.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'drivers/bus')

diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 4d6a2b7e4d3f..80758f6fdaa5 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -1547,6 +1547,7 @@ static const struct of_device_id arm_ccn_match[] = {
 	{ .compatible = "arm,ccn-504", },
 	{},
 };
+MODULE_DEVICE_TABLE(of, arm_ccn_match);
 
 static struct platform_driver arm_ccn_driver = {
 	.driver = {
-- 
cgit v1.2.3


From 0a240c5b420194c24882748f1ea35f37643b032e Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 19 Apr 2017 09:12:43 +0200
Subject: bus: arm-ccn: Use devm_kcalloc() in arm_ccn_probe()

Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "devm_kcalloc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 drivers/bus/arm-ccn.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'drivers/bus')

diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 80758f6fdaa5..5aaa645ba726 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -1520,10 +1520,10 @@ static int arm_ccn_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	ccn->node = devm_kzalloc(ccn->dev, sizeof(*ccn->node) * ccn->num_nodes,
-		GFP_KERNEL);
-	ccn->xp = devm_kzalloc(ccn->dev, sizeof(*ccn->node) * ccn->num_xps,
-		GFP_KERNEL);
+	ccn->node = devm_kcalloc(ccn->dev, ccn->num_nodes, sizeof(*ccn->node),
+				 GFP_KERNEL);
+	ccn->xp = devm_kcalloc(ccn->dev, ccn->num_xps, sizeof(*ccn->node),
+			       GFP_KERNEL);
 	if (!ccn->node || !ccn->xp)
 		return -ENOMEM;
 
-- 
cgit v1.2.3


From 2941be2166c2146ded1d1806ae76e78c26b8d4fe Mon Sep 17 00:00:00 2001
From: Velibor Markovski <velibor.markovski@broadcom.com>
Date: Thu, 15 Jun 2017 23:39:13 -0700
Subject: bus: arm-ccn: Enable stats for CCN-502 interconnect

Add compatible string for the ARM CCN-502 interconnect

Signed-off-by: Velibor Markovski <velibor.markovski@broadcom.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 drivers/bus/arm-ccn.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'drivers/bus')

diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 5aaa645ba726..e8c6946fed9d 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -1544,6 +1544,7 @@ static int arm_ccn_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id arm_ccn_match[] = {
+	{ .compatible = "arm,ccn-502", },
 	{ .compatible = "arm,ccn-504", },
 	{},
 };
-- 
cgit v1.2.3