aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-01-31 14:21:53 +0100
committerRafał Miłecki <rafal@milecki.pl>2017-01-31 14:45:52 +0100
commite3849823e046a3c5f16d3f31e2b0b6d62351f8c2 (patch)
tree8fa757a01d8dca26ddeb7244e38c3a4919e829f6 /target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
parent5f2a1ac59aa996cf749e27cea30aca4270a4ef9c (diff)
downloadupstream-e3849823e046a3c5f16d3f31e2b0b6d62351f8c2.tar.gz
upstream-e3849823e046a3c5f16d3f31e2b0b6d62351f8c2.tar.bz2
upstream-e3849823e046a3c5f16d3f31e2b0b6d62351f8c2.zip
kernel: update bcma to fix devm memory leaks
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/patches-4.4/023-bcma-from-4.9.patch')
-rw-r--r--target/linux/generic/patches-4.4/023-bcma-from-4.9.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch b/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
index 0391bcb802..027054c162 100644
--- a/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
+++ b/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
@@ -80,3 +80,29 @@
/* Board types (on PCI usually equals to the subsystem dev id) */
/* BCM4313 */
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -209,6 +209,8 @@ static void bcma_of_fill_device(struct p
+ core->dev.of_node = node;
+
+ core->irq = bcma_of_get_irq(parent, core, 0);
++
++ of_dma_configure(&core->dev, node);
+ }
+
+ unsigned int bcma_core_irq(struct bcma_device *core, int num)
+@@ -248,12 +250,12 @@ void bcma_prepare_core(struct bcma_bus *
+ core->irq = bus->host_pci->irq;
+ break;
+ case BCMA_HOSTTYPE_SOC:
+- core->dev.dma_mask = &core->dev.coherent_dma_mask;
+- if (bus->host_pdev) {
++ if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) {
+ core->dma_dev = &bus->host_pdev->dev;
+ core->dev.parent = &bus->host_pdev->dev;
+ bcma_of_fill_device(bus->host_pdev, core);
+ } else {
++ core->dev.dma_mask = &core->dev.coherent_dma_mask;
+ core->dma_dev = &core->dev;
+ }
+ break;