From 90bfbf16c895aa53e1d017d4ce7f4f8121e0da3c Mon Sep 17 00:00:00 2001 From: Andrey Gusakov Date: Fri, 7 Jul 2017 20:45:01 +0300 Subject: [PATCH 113/114] MOST: core: fix memory allocation at arm64 Provide valid dev pointer to dma_alloc_coherent Signed-off-by: Andrey Gusakov --- drivers/staging/most/hdm-dim2/dim2_hdm.c | 1 + drivers/staging/most/mostcore/core.c | 2 +- drivers/staging/most/mostcore/mostcore.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c b/drivers/staging/most/hdm-dim2/dim2_hdm.c index c1beabc28fa8..81edf4f4beb3 100644 --- a/drivers/staging/most/hdm-dim2/dim2_hdm.c +++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c @@ -852,6 +852,7 @@ static int dim2_probe(struct platform_device *pdev) dev->most_iface.enqueue = enqueue; dev->most_iface.poison_channel = poison_channel; dev->most_iface.request_netinfo = request_netinfo; + dev->most_iface.dev = &pdev->dev; if (np) { const char *tmp; diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index 7c619feb12d3..ce56d5ca582c 100644 --- a/drivers/staging/most/mostcore/core.c +++ b/drivers/staging/most/mostcore/core.c @@ -1265,7 +1265,7 @@ static int arm_mbo_chain(struct most_c_obj *c, int dir, mbo->context = c; mbo->ifp = c->iface; mbo->hdm_channel_id = c->channel_id; - mbo->virt_address = dma_alloc_coherent(NULL, + mbo->virt_address = dma_alloc_coherent(c->iface->dev, coherent_buf_size, &mbo->bus_address, GFP_KERNEL); diff --git a/drivers/staging/most/mostcore/mostcore.h b/drivers/staging/most/mostcore/mostcore.h index 60e018e499ef..334908639067 100644 --- a/drivers/staging/most/mostcore/mostcore.h +++ b/drivers/staging/most/mostcore/mostcore.h @@ -247,6 +247,7 @@ struct most_interface { struct mbo *mbo); int (*poison_channel)(struct most_interface *iface, int channel_idx); void (*request_netinfo)(struct most_interface *iface, int channel_idx); + struct device *dev; void *priv; }; -- 2.13.0