[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACPK8XfYgEUfaK6rtr+FdEq-Vau6d4wE2Rvfp6Q4G2-kjVLT0g@mail.gmail.com>
Date: Mon, 2 Sep 2019 04:12:51 +0000
From: Joel Stanley <joel@....id.au>
To: Andrew Jeffery <andrew@...id.au>, Arnd Bergmann <arnd@...db.de>
Cc: linux-mmc@...r.kernel.org, adrian.hunter@...el.com,
Ulf Hansson <ulf.hansson@...aro.org>,
OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-aspeed <linux-aspeed@...ts.ozlabs.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kbuild test robot <lkp@...el.com>
Subject: Re: [PATCH v2 1/4] mmc: sdhci-of-aspeed: Fix link failure for SPARC
On Mon, 2 Sep 2019 at 03:58, Andrew Jeffery <andrew@...id.au> wrote:
>
> Resolves the following build error reported by the 0-day bot:
>
> ERROR: "of_platform_device_create" [drivers/mmc/host/sdhci-of-aspeed.ko] undefined!
>
> SPARC does not set CONFIG_OF_ADDRESS so the symbol is missing. Guard the
> callsite to maintain build coverage for the rest of the driver.
>
> Reported-by: kbuild test robot <lkp@...el.com>
> Signed-off-by: Andrew Jeffery <andrew@...id.au>
> ---
> drivers/mmc/host/sdhci-of-aspeed.c | 38 ++++++++++++++++++++----------
> 1 file changed, 25 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
> index d5acb5afc50f..96ca494752c5 100644
> --- a/drivers/mmc/host/sdhci-of-aspeed.c
> +++ b/drivers/mmc/host/sdhci-of-aspeed.c
> @@ -224,10 +224,30 @@ static struct platform_driver aspeed_sdhci_driver = {
> .remove = aspeed_sdhci_remove,
> };
>
> -static int aspeed_sdc_probe(struct platform_device *pdev)
> -
> +static int aspeed_sdc_create_sdhcis(struct platform_device *pdev)
> {
> +#if defined(CONFIG_OF_ADDRESS)
This is going to be untested code forever, as no one will be running
on a chip with this hardware present but OF_ADDRESS disabled.
How about we make the driver depend on OF_ADDRESS instead?
Cheers,
Joel
> struct device_node *parent, *child;
> +
> + parent = pdev->dev.of_node;
> +
> + for_each_available_child_of_node(parent, child) {
> + struct platform_device *cpdev;
> +
> + cpdev = of_platform_device_create(child, NULL, &pdev->dev);
> + if (!cpdev) {
> + of_node_put(child);
> + return -ENODEV;
> + }
> + }
> +#endif
> +
> + return 0;
> +}
> +
> +static int aspeed_sdc_probe(struct platform_device *pdev)
> +
> +{
> struct aspeed_sdc *sdc;
> int ret;
>
> @@ -256,17 +276,9 @@ static int aspeed_sdc_probe(struct platform_device *pdev)
>
> dev_set_drvdata(&pdev->dev, sdc);
>
> - parent = pdev->dev.of_node;
> - for_each_available_child_of_node(parent, child) {
> - struct platform_device *cpdev;
> -
> - cpdev = of_platform_device_create(child, NULL, &pdev->dev);
> - if (!cpdev) {
> - of_node_put(child);
> - ret = -ENODEV;
> - goto err_clk;
> - }
> - }
> + ret = aspeed_sdc_create_sdhcis(pdev);
> + if (ret)
> + goto err_clk;
>
> return 0;
>
> --
> 2.20.1
>
Powered by blists - more mailing lists