mmc: sdhci-of-aspeed: Fix kunit-related build error
authorAndrew Jeffery <andrew@aj.id.au>
Fri, 22 Jan 2021 11:48:52 +0000 (22:18 +1030)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Feb 2021 10:54:49 +0000 (11:54 +0100)
commit4af307f574260cb1b768be84c81ce572da7a84ea
tree763cce9676c1e5bf8398bae2efd67459a92546e7
parentc7b9f01fd12a46333c917f416b0df6ee39e7c774
mmc: sdhci-of-aspeed: Fix kunit-related build error

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 <andrew@aj.id.au>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Link: https://lore.kernel.org/r/20210122114852.3790565-1-andrew@aj.id.au
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-of-aspeed-test.c
drivers/mmc/host/sdhci-of-aspeed.c