From: David Heidelberg <[email protected]> The wcd934x MFD parent (a slim_device) never initializes its dma_mask/coherent_dma_mask. When the DT-aware children pass through of_dma_configure() this triggers the "DMA mask not set" warning for each child.
Cc: [email protected] Fixes: f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference") Assisted-by: tencent:hy3 Signed-off-by: David Heidelberg <[email protected]> --- drivers/mfd/wcd934x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c index 3a939e7ad3da5..fc17c39791301 100644 --- a/drivers/mfd/wcd934x.c +++ b/drivers/mfd/wcd934x.c @@ -1,12 +1,13 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2019, Linaro Limited #include <linux/clk.h> +#include <linux/dma-mapping.h> #include <linux/gpio/consumer.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/mfd/core.h> #include <linux/mfd/wcd934x/registers.h> #include <linux/mfd/wcd934x/wcd934x.h> #include <linux/module.h> #include <linux/of.h> @@ -212,16 +213,21 @@ static int wcd934x_slim_status(struct slim_device *sdev, static int wcd934x_slim_probe(struct slim_device *sdev) { struct device *dev = &sdev->dev; struct device_node *np = dev->of_node; struct wcd934x_ddata *ddata; struct gpio_desc *reset_gpio; int ret; + ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); + if (ret) + return dev_err_probe(dev, ret, + "Failed to set dma mask\n"); + ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); if (!ddata) return -ENOMEM; ddata->irq = of_irq_get(np, 0); if (ddata->irq < 0) return dev_err_probe(dev, ddata->irq, "Failed to get IRQ\n"); -- 2.55.0

