Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp103744ybe; Sun, 1 Sep 2019 21:26:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHcV97ToTeajaQLznwLYcQz0tkHnv+jkP0YApl7v+DHSKaLbTAJ48Ovq4ecU25MChE53OZ X-Received: by 2002:aa7:8c4c:: with SMTP id e12mr32425959pfd.258.1567398389493; Sun, 01 Sep 2019 21:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567398389; cv=none; d=google.com; s=arc-20160816; b=dFEfZuh6HpjoFGCQMKttBSd7nJoa9/NSYnZvyzKRZ+2dEemVFWda4TE884UdC3Pyz2 6Pu8H2/Uvv1JwUcpQRluuHpcL3OHULJNSbDIJz6yDWZ1FxAyVIVrLgeSkDTxVSS8oWR6 3ssS68sutHLPZp6H+X9AsyyToU1ZmaozC4wUK8r6cXCKEyezkiytdTwbZ1ldx7ls8YHJ XRgJIgb2S2awocvD5zQYM/mv7X47SUZDVIW5PcZsDiDjNU9ql0UOSpHt+86X7ZRBvYcF S+ObP2Xndk1jnygb/yltlQ3VVV+3fY3/xiH6OVarCznf4EyuBq+1oGARCEUwC4k1bUk9 r5Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tEtrc1rdzh/Z7dC3mMEoNjpzKu9VEPrGxsmA4Ux5oa0=; b=n8ftj06g6WoqqRLU639WBKyKUjT6sKV7nxlft/r2XcIOTl3DRfHvdLFIbkVKeLzRcV 2RSVrj4+YGvaTHudZ3VOyJ4yvQz9uh8BjTFoZJzkjkIU5xUkdJdiZSlAHF8NnlmfxNBI uhxqpTFiq9Ipdd6QESf6ZwQoUKlswAaeIlYjBZp/o2FzrbPoozYEyDgOS2NT02rTs56c gJcz+nf6F6PrswOXFyS3TVK2x8/J9FPTmK3c1Uxy6AvxrRB9rUOoYd5QCqHyhJrHuuQC pGz1P26DcV2/mLvXxzANFaa2VdZiosAUdMV9Y3L9aKLWfj7/QHDaPxK2civFoAO58zgQ ye4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=dN7IQbc7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y63si10587609pgd.403.2019.09.01.21.26.14; Sun, 01 Sep 2019 21:26:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=dN7IQbc7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729371AbfIBENE (ORCPT + 99 others); Mon, 2 Sep 2019 00:13:04 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34488 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbfIBENE (ORCPT ); Mon, 2 Sep 2019 00:13:04 -0400 Received: by mail-qk1-f194.google.com with SMTP id q203so2226953qke.1; Sun, 01 Sep 2019 21:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tEtrc1rdzh/Z7dC3mMEoNjpzKu9VEPrGxsmA4Ux5oa0=; b=dN7IQbc7odvWieIZ5FEdT/iecR2k9co0ZKCiVEoF2+XtJgJEdBx8dxIzOy3zhL02jM Ng4NLHSa7h/5wwE7q5SJd047yMm+wIvJm2pobbFMrlKBydk8kDSkH9Vuy1khb04sb0IG QvFDdo4L8E5TGP0OzMn69C3bccFG0s+t/Y2hM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tEtrc1rdzh/Z7dC3mMEoNjpzKu9VEPrGxsmA4Ux5oa0=; b=orcVABPt4ULBT+94U0s03B1Zlt25T7Au5CY7K4BwxixIggbbSsh+3DmqSL/BAJ4h+C 0xf11/39xkewqQF6845saZZCt0QgasBnlVkROvJ3qDhSCZZzcw0Jsu0m1XdO2HrPioE5 Onj+GLL7CvAQU7fCm3wHWJKdGFN13E3hgpxXnpOjcIp3lfGPClFZayAU7yn5rqwjXtbJ EvsZL3UjAMeKPW8nBAPnz0X0yoA3rGYDHSNrNh+ANx83tFyalMDdXx7SYAw41decAJgV nLk90URF1cKFrVnNV1jlbmbnBk+pLVub6tn1owO3aw9+14t4FH4Jn9KMVaMmKpdVRYL/ EK2Q== X-Gm-Message-State: APjAAAUeBQG9mBnYBJF8B3j7MgTDa4d6JTVJ82Zifyol7x3jpvJrCBTY aqvgA83U5SzAe8UBEGye1y/Y8tsyzTUuEzvrykRbunPU X-Received: by 2002:a37:4f4c:: with SMTP id d73mr13799291qkb.171.1567397583086; Sun, 01 Sep 2019 21:13:03 -0700 (PDT) MIME-Version: 1.0 References: <20190902035842.2747-1-andrew@aj.id.au> <20190902035842.2747-2-andrew@aj.id.au> In-Reply-To: <20190902035842.2747-2-andrew@aj.id.au> From: Joel Stanley Date: Mon, 2 Sep 2019 04:12:51 +0000 Message-ID: Subject: Re: [PATCH v2 1/4] mmc: sdhci-of-aspeed: Fix link failure for SPARC To: Andrew Jeffery , Arnd Bergmann Cc: linux-mmc@vger.kernel.org, adrian.hunter@intel.com, Ulf Hansson , OpenBMC Maillist , Linux ARM , linux-aspeed , Linux Kernel Mailing List , kbuild test robot Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Sep 2019 at 03:58, Andrew Jeffery 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 > Signed-off-by: Andrew Jeffery > --- > 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 >