mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Lubomir Rintel <lkundrak@v3.sk>
Cc: Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: pxa2xx: Fix '"CONFIG_OF" is not defined' warning
Date: Wed, 14 Nov 2018 20:15:52 +0100	[thread overview]
Message-ID: <87lg5vjwrb.fsf@belgarion.home> (raw)
In-Reply-To: <20181114173107.1229717-1-lkundrak@v3.sk> (Lubomir Rintel's message of "Wed, 14 Nov 2018 18:31:07 +0100")

Lubomir Rintel <lkundrak@v3.sk> writes:

> A careless oversight. Sorry.
>
> Fixes: 0a897143b7c9 ("spi: pxa2xx: Add slave mode support")
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> ---
>  drivers/spi/spi-pxa2xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
> index 29e6025f104c..7194070e4009 100644
> --- a/drivers/spi/spi-pxa2xx.c
> +++ b/drivers/spi/spi-pxa2xx.c
> @@ -1555,7 +1555,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
>  	}
>  #endif
>  
> -#if CONFIG_OF
> +#ifdef CONFIG_OF
>  	if (of_id) {
>  		pdata->is_slave = of_property_read_bool(pdev->dev.of_node,
>  								"spi-slave");
While at it, why not simply remove the "#if CONFIG_OF", the if (of_id), and
write simply this, without any ifs ? :
	pdata->is_slave = of_property_read_bool(pdev->dev.of_node,
						"spi-slave");

If CONFIG_OF=n, of_property_read_bool() is guaranteed to return false. If the
device is not found through devicetree, of_node == NULL and a false will
still be returned. And the last case is your bool read case (ie. when devicetree
probed the device).

Cheers.

-- 
Robert

      reply	other threads:[~2018-11-14 19:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 17:31 Lubomir Rintel
2018-11-14 19:15 ` Robert Jarzmik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lg5vjwrb.fsf@belgarion.home \
    --to=robert.jarzmik@free.fr \
    --cc=broonie@kernel.org \
    --cc=daniel@zonque.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®