ASoc: amd: acp3x: Add missing include <linux/io.h>
diff mbox series

Message ID 20200304084057.44764-1-yuehaibing@huawei.com
State Accepted
Commit 14beaccc36dc9c1afbe6da627b873bf1d6849234
Headers show
Series
  • ASoc: amd: acp3x: Add missing include <linux/io.h>
Related show

Commit Message

YueHaibing March 4, 2020, 8:40 a.m. UTC
gcc 7.4.0 build fails:

In file included from sound/soc/amd/acp3x-rt5682-max9836.c:20:0:
sound/soc/amd/raven/acp3x.h: In function rv_readl:
sound/soc/amd/raven/acp3x.h:113:9: error: implicit declaration of function readl; did you mean rv_readl? [-Werror=implicit-function-declaration]
  return readl(base_addr - ACP3x_PHY_BASE_ADDRESS);
         ^~~~~
         rv_readl
sound/soc/amd/raven/acp3x.h: In function rv_writel:
sound/soc/amd/raven/acp3x.h:118:2: error: implicit declaration of function writel; did you mean rv_writel? [-Werror=implicit-function-declaration]
  writel(val, base_addr - ACP3x_PHY_BASE_ADDRESS);
  ^~~~~~
  rv_writel

Add <linux/io.h> to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 sound/soc/amd/acp3x-rt5682-max9836.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Agrawal, Akshu March 5, 2020, 10:07 a.m. UTC | #1
On 3/4/2020 2:10 PM, YueHaibing wrote:
> gcc 7.4.0 build fails:
>
> In file included from sound/soc/amd/acp3x-rt5682-max9836.c:20:0:
> sound/soc/amd/raven/acp3x.h: In function rv_readl:
> sound/soc/amd/raven/acp3x.h:113:9: error: implicit declaration of function readl; did you mean rv_readl? [-Werror=implicit-function-declaration]
>    return readl(base_addr - ACP3x_PHY_BASE_ADDRESS);
>           ^~~~~
>           rv_readl
> sound/soc/amd/raven/acp3x.h: In function rv_writel:
> sound/soc/amd/raven/acp3x.h:118:2: error: implicit declaration of function writel; did you mean rv_writel? [-Werror=implicit-function-declaration]
>    writel(val, base_addr - ACP3x_PHY_BASE_ADDRESS);
>    ^~~~~~
>    rv_writel
We don't hit this error and neither with i386-allyesconfig. Would be 
interesting to know with which config do you get this error.
>
> Add <linux/io.h> to fix this.

Since readl and writel are used by acp3x.h, it would be better to 
include linux/io.h in acp3x.h and avoid including it in every file which 
includes acp3x.h

Thanks,

Akshu

Patch
diff mbox series

diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c
index 511b8b1..b4f68c5 100644
--- a/sound/soc/amd/acp3x-rt5682-max9836.c
+++ b/sound/soc/amd/acp3x-rt5682-max9836.c
@@ -16,6 +16,7 @@ 
 #include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
+#include <linux/io.h>
 #include <linux/acpi.h>
 
 #include "raven/acp3x.h"