From 18096cb0bcff1ebf4459ea5f6dc940d8eaf4b942 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 8 Oct 2020 11:54:00 +0300 Subject: ASoC: ti: davinci-mcasp: Use &pdev->dev for early dev_warn At this point mcasp->dev is not initialized and we would have NULL pointer dereference if we would have failed to get the mem memory resource by name. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20201008085400.19944-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown --- sound/soc/ti/davinci-mcasp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc/ti') diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c index 3ffdd0f6292a..a6b72ad53b43 100644 --- a/sound/soc/ti/davinci-mcasp.c +++ b/sound/soc/ti/davinci-mcasp.c @@ -2155,7 +2155,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); if (!mem) { - dev_warn(mcasp->dev, + dev_warn(&pdev->dev, "\"mpu\" mem resource not found, using index 0\n"); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) { -- cgit v1.2.3