From patchwork Fri May 27 14:18:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 9138513 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42E5260759 for ; Fri, 27 May 2016 14:21:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3561628312 for ; Fri, 27 May 2016 14:21:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 277802830F; Fri, 27 May 2016 14:21:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1DEB28313 for ; Fri, 27 May 2016 14:21:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932306AbcE0OSp (ORCPT ); Fri, 27 May 2016 10:18:45 -0400 Received: from lists.s-osg.org ([54.187.51.154]:55278 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932125AbcE0OSo (ORCPT ); Fri, 27 May 2016 10:18:44 -0400 Received: from minerva.sisa.samsung.com (host-107.58.217.201.copaco.com.py [201.217.58.107]) by lists.s-osg.org (Postfix) with ESMTPSA id 2E646E28DD; Fri, 27 May 2016 07:19:14 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Xinming Hu , Javier Martinez Canillas , Amitkumar Karwar , Kalle Valo , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Nishant Sarmukadam 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 Message-Id: <1464358702-19083-2-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464358702-19083-1-git-send-email-javier@osg.samsung.com> References: <1464358702-19083-1-git-send-email-javier@osg.samsung.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Julian Calaby --- 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)) {