From patchwork Wed Jan 30 08:53:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 2066301 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7B950DF264 for ; Wed, 30 Jan 2013 08:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754074Ab3A3IyM (ORCPT ); Wed, 30 Jan 2013 03:54:12 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:59753 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753184Ab3A3IyL (ORCPT ); Wed, 30 Jan 2013 03:54:11 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0U8sBoQ029967 for ; Wed, 30 Jan 2013 02:54:11 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0U8sBde006964 for ; Wed, 30 Jan 2013 02:54:11 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Wed, 30 Jan 2013 02:54:10 -0600 Received: from cumari.coelho.fi (h78-1.vpn.ti.com [172.24.78.1]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0U8s94f020204; Wed, 30 Jan 2013 02:54:10 -0600 From: Luciano Coelho To: CC: Subject: [PATCH] wlcore: don't hide real error code when booting fails Date: Wed, 30 Jan 2013 10:53:14 +0200 Message-ID: <1359535995-18092-1-git-send-email-coelho@ti.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There's no need to hide the actual error that was reported when booting fails. For instance, on I/O error, we were returing -EINVALID, which doesn't make sense at all. Signed-off-by: Luciano Coelho --- drivers/net/wireless/ti/wlcore/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 731dd26..6455e2d 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -2072,7 +2072,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif) return 0; } -static bool wl12xx_init_fw(struct wl1271 *wl) +static int wl12xx_init_fw(struct wl1271 *wl) { int retries = WL1271_BOOT_RETRIES; bool booted = false; @@ -2138,7 +2138,7 @@ power_off: wl->state = WLCORE_STATE_ON; out: - return booted; + return ret; } static bool wl12xx_dev_role_started(struct wl12xx_vif *wlvif) @@ -2206,7 +2206,6 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, struct vif_counter_data vif_count; int ret = 0; u8 role_type; - bool booted = false; vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER | IEEE80211_VIF_SUPPORTS_CQM_RSSI; @@ -2263,11 +2262,9 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, */ memcpy(wl->addresses[0].addr, vif->addr, ETH_ALEN); - booted = wl12xx_init_fw(wl); - if (!booted) { - ret = -EINVAL; + ret = wl12xx_init_fw(wl); + if (ret < 0) goto out; - } } ret = wl12xx_cmd_role_enable(wl, vif->addr,