All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Xinming Hu <huxm@marvell.com>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Amitkumar Karwar <akarwar@marvell.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	Nishant Sarmukadam <nishants@marvell.com>
Subject: [PATCH 1/8] mwifiex: only call mwifiex_sdio_probe_of() if dev has an OF node
Date: Fri, 27 May 2016 10:18:15 -0400	[thread overview]
Message-ID: <1464358702-19083-2-git-send-email-javier@osg.samsung.com> (raw)
In-Reply-To: <1464358702-19083-1-git-send-email-javier@osg.samsung.com>

SDIO is an auto enumerable bus so the SDIO devices are matched using the
sdio_device_id table and not using compatible strings from a OF id table.

However, commit ce4f6f0c353b ("mwifiex: add platform specific wakeup
interrupt support") allowed to match nodes defined as child of the SDIO
host controller in the probe function using a compatible string to setup
platform specific parameters in the DT.

The problem is that the OF parse function is always called regardless if
the SDIO dev has an OF node associated or not, and prints an error if it
is not found. So, on a platform that doesn't have a node for a SDIO dev,
the following misleading error message will be printed:

[  12.480042] mwifiex_sdio mmc2:0001:1: sdio platform data not available

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/net/wireless/marvell/mwifiex/sdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index bdc51ffd43ec..285b1b68f7e9 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -102,8 +102,7 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card)
 	struct mwifiex_plt_wake_cfg *cfg;
 	int ret;
 
-	if (!dev->of_node ||
-	    !of_match_node(mwifiex_sdio_of_match_table, dev->of_node)) {
+	if (!of_match_node(mwifiex_sdio_of_match_table, dev->of_node)) {
 		dev_err(dev, "sdio platform data not available\n");
 		return -1;
 	}
@@ -189,7 +188,8 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
 	}
 
 	/* device tree node parsing and platform specific configuration*/
-	mwifiex_sdio_probe_of(&func->dev, card);
+	if (func->dev.of_node)
+		mwifiex_sdio_probe_of(&func->dev, card);
 
 	if (mwifiex_add_card(card, &add_remove_card_sem, &sdio_ops,
 			     MWIFIEX_SDIO)) {
-- 
2.5.5


  reply	other threads:[~2016-05-27 14:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 14:18 [PATCH 0/8] mwifiex: Fix some error handling issues in mwifiex_sdio_probe() function Javier Martinez Canillas
2016-05-27 14:18 ` Javier Martinez Canillas [this message]
2016-06-01  4:14   ` [PATCH 1/8] mwifiex: only call mwifiex_sdio_probe_of() if dev has an OF node Julian Calaby
2016-06-01  4:14     ` Julian Calaby
2016-06-16 15:05   ` [1/8] " Kalle Valo
2016-05-27 14:18 ` [PATCH 2/8] mwifiex: propagate sdio_enable_func() errno code in mwifiex_sdio_probe() Javier Martinez Canillas
2016-06-01  4:15   ` Julian Calaby
2016-05-27 14:18 ` [PATCH 3/8] mwifiex: propagate mwifiex_add_card() " Javier Martinez Canillas
2016-06-01  4:17   ` Julian Calaby
2016-05-27 14:18 ` [PATCH 4/8] mwifiex: consolidate mwifiex_sdio_probe() error paths Javier Martinez Canillas
2016-06-01  4:18   ` Julian Calaby
2016-05-27 14:18 ` [PATCH 5/8] mwifiex: use dev_err() instead of pr_err() in mwifiex_sdio_probe() Javier Martinez Canillas
2016-06-01  4:16   ` Julian Calaby
2016-05-27 14:18 ` [PATCH 6/8] mwifiex: check if mwifiex_sdio_probe_of() fails and return error Javier Martinez Canillas
2016-06-01  4:19   ` Julian Calaby
2016-05-27 14:18 ` [PATCH 7/8] mwifiex: don't print an error if an optional DT property is missing Javier Martinez Canillas
2016-06-01  4:20   ` Julian Calaby
2016-06-01 13:51     ` Javier Martinez Canillas
2016-06-01 23:13       ` Julian Calaby
2016-06-09 13:51         ` Amitkumar Karwar
2016-06-09 13:51           ` Amitkumar Karwar
2016-05-27 14:18 ` [PATCH 8/8] mwifiex: use better message and error code when OF node doesn't match Javier Martinez Canillas
2016-06-01  4:23   ` Julian Calaby
2016-05-30  9:57 ` [PATCH 0/8] mwifiex: Fix some error handling issues in mwifiex_sdio_probe() function Enric Balletbo Serra
2016-06-09 13:43 ` Amitkumar Karwar

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=1464358702-19083-2-git-send-email-javier@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=akarwar@marvell.com \
    --cc=huxm@marvell.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nishants@marvell.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.