From patchwork Fri Mar 18 03:10:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 642731 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 p2I3ARxq016129 for ; Fri, 18 Mar 2011 03:10:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932245Ab1CRDKY (ORCPT ); Thu, 17 Mar 2011 23:10:24 -0400 Received: from mail.atheros.com ([12.19.149.2]:41075 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932237Ab1CRDKY (ORCPT ); Thu, 17 Mar 2011 23:10:24 -0400 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Thu, 17 Mar 2011 20:10:00 -0700 Received: from tux (10.10.11.113) by SC1EXHC-01.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS) id 8.2.213.0; Thu, 17 Mar 2011 20:10:23 -0700 Received: by tux (sSMTP sendmail emulation); Thu, 17 Mar 2011 20:10:21 -0700 From: "Luis R. Rodriguez" To: CC: , , , , "Luis R. Rodriguez" , , Naveen Singh , Wey-Yi Guy , Intel Linux Wireless Subject: [RTF] iwmc3200wifi: fix device registration ordering for cfg80211 Date: Thu, 17 Mar 2011 20:10:20 -0700 Message-ID: <1300417820-19029-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 03:10:27 +0000 (UTC) diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c index ed57e44..2f48f72 100644 --- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c +++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c @@ -837,17 +837,8 @@ struct wireless_dev *iwm_wdev_alloc(int sizeof_bus, 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) { - dev_err(dev, "Couldn't register wiphy device\n"); - goto out_err_register; - } - return wdev; - out_err_register: - wiphy_free(wdev->wiphy); - out_err_new: kfree(wdev); diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c index 5091d77..731058e 100644 --- a/drivers/net/wireless/iwmc3200wifi/netdev.c +++ b/drivers/net/wireless/iwmc3200wifi/netdev.c @@ -145,6 +145,12 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev, iwm_init_default_profile(iwm, iwm->umac_profile); + ret = wiphy_register(wdev->wiphy); + if (ret < 0) { + dev_err(dev, "Couldn't register wiphy device\n"); + goto out_profile; + } + return iwm; out_profile: