* [PATCH] spi: pxa2xx: Fix '"CONFIG_OF" is not defined' warning
@ 2018-11-14 17:31 Lubomir Rintel
2018-11-14 19:15 ` Robert Jarzmik
0 siblings, 1 reply; 2+ messages in thread
From: Lubomir Rintel @ 2018-11-14 17:31 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik
Cc: Mark Brown, linux-spi, linux-kernel, Lubomir Rintel
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");
--
2.19.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: pxa2xx: Fix '"CONFIG_OF" is not defined' warning
2018-11-14 17:31 [PATCH] spi: pxa2xx: Fix '"CONFIG_OF" is not defined' warning Lubomir Rintel
@ 2018-11-14 19:15 ` Robert Jarzmik
0 siblings, 0 replies; 2+ messages in thread
From: Robert Jarzmik @ 2018-11-14 19:15 UTC (permalink / raw)
To: Lubomir Rintel
Cc: Daniel Mack, Haojian Zhuang, Mark Brown, linux-spi, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-14 19:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 17:31 [PATCH] spi: pxa2xx: Fix '"CONFIG_OF" is not defined' warning Lubomir Rintel
2018-11-14 19:15 ` Robert Jarzmik
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®