# \[PATCH v2\] mmc: sdhci-of-aspeed: Fix kunit-related build error

- From: Randy Dunlap \<rdunlap@infradead.org\>
- Date: 2021-01-22 18:19:22 
- List: linux-aspeed
- Page: https://ratatoskr.run/linux-aspeed/2021/01/6244661
- Thread: https://ratatoskr.run/linux-mmc/2021/01/6244113/t.md

````text
On 1/22/21 3:48 AM, Andrew Jeffery wrote:
> Randy found that with the following Kconfig settings we have duplicate
> definitions (e.g. __inittest()) in sdhci-of-aspeed due to competing
> module_init()/module_exit() calls from kunit and driver the itself.
> 
> ```
> CONFIG_MMC_SDHCI_OF_ASPEED=m
> CONFIG_MMC_SDHCI_OF_ASPEED_TEST=y
> ```
> 
> Conditionally open-code the kunit initialisation to avoid the error.
> 
> Fixes: 7efa02a981d6 ("mmc: sdhci-of-aspeed: Add KUnit tests for phase calculations")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Andrew Jeffery <redacted>
> ---
> 
> v2:
> * Collapse the #ifdef-ery
> 
>  drivers/mmc/host/sdhci-of-aspeed-test.c |  9 +++++-
>  drivers/mmc/host/sdhci-of-aspeed.c      | 42 ++++++++++++++++++++++---
>  2 files changed, 45 insertions(+), 6 deletions(-)

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.


-- 
~Randy

````
