From patchwork Fri Mar 18 02:45:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 642691 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2I2jIVu002527 for ; Fri, 18 Mar 2011 02:45:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755896Ab1CRCpQ (ORCPT ); Thu, 17 Mar 2011 22:45:16 -0400 Received: from mail.atheros.com ([12.19.149.2]:39001 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755775Ab1CRCpQ (ORCPT ); Thu, 17 Mar 2011 22:45:16 -0400 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Thu, 17 Mar 2011 19:44:53 -0700 Received: from tux (10.10.11.113) by SC1EXHC-01.global.atheros.com (10.10.20.111) with Microsoft SMTP Server (TLS) id 8.2.213.0; Thu, 17 Mar 2011 19:45:14 -0700 Received: by tux (sSMTP sendmail emulation); Thu, 17 Mar 2011 19:45:13 -0700 From: "Luis R. Rodriguez" To: CC: , , , , "Luis R. Rodriguez" , Subject: [PATCH] ath6kl: fix device registration ordering Date: Thu, 17 Mar 2011 19:45:12 -0700 Message-ID: <1300416312-16808-1-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.7.4.15.g7811d MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 18 Mar 2011 02:45:19 +0000 (UTC) diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c index 6ca147f..67e89c4 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c @@ -1842,11 +1842,19 @@ ar6000_avail_ev(void *context, void *hif_handle) dev->name, (unsigned long)ar->arHifDevice, (unsigned long)dev, device_index, (unsigned long)ar)); +#ifdef ATH6K_CONFIG_CFG80211 + init_status = wiphy_register(wdev->wiphy); +#endif + avail_ev_failed : if (init_status) { if (bmienable) { ar6000_sysfs_bmi_deinit(ar); } +#ifdef ATH6K_CONFIG_CFG80211 + ar6k_cfg80211_deinit(ar); +#endif + } return init_status; diff --git a/drivers/staging/ath6kl/os/linux/cfg80211.c b/drivers/staging/ath6kl/os/linux/cfg80211.c index 1f799c1..17a572a 100644 --- a/drivers/staging/ath6kl/os/linux/cfg80211.c +++ b/drivers/staging/ath6kl/os/linux/cfg80211.c @@ -1416,7 +1416,6 @@ cfg80211_ops ar6k_cfg80211_ops = { struct wireless_dev * ar6k_cfg80211_init(struct device *dev) { - int ret = 0; struct wireless_dev *wdev; AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); @@ -1451,14 +1450,6 @@ ar6k_cfg80211_init(struct device *dev) wdev->wiphy->cipher_suites = cipher_suites; wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); - ret = wiphy_register(wdev->wiphy); - if(ret < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: Couldn't register wiphy device\n", __func__)); - wiphy_free(wdev->wiphy); - return ERR_PTR(ret); - } - return wdev; }