From: Felipe Balbi <balbi@ti.com>
To: Luciano Coelho <coelho@ti.com>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Felipe Balbi <balbi@ti.com>
Subject: [RFC/PATCH 13/13] net: wl12xx: main: drop unneded plat_dev
Date: Sat, 14 May 2011 00:26:30 +0300 [thread overview]
Message-ID: <1305321990-22041-14-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1305321990-22041-1-git-send-email-balbi@ti.com>
now that useless plat_dev is unnecessary,
we can remove it.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/wireless/wl12xx/main.c | 48 +++-------------------------------
drivers/net/wireless/wl12xx/wl12xx.h | 1 -
2 files changed, 4 insertions(+), 45 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index d3c056d..55cedcd 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -315,21 +315,6 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl);
static void wl1271_free_ap_keys(struct wl1271 *wl);
-static void wl1271_device_release(struct device *dev)
-{
-
-}
-
-static struct platform_device wl1271_device = {
- .name = "wl1271",
- .id = -1,
-
- /* device model insists to have a release function */
- .dev = {
- .release = wl1271_device_release,
- },
-};
-
static LIST_HEAD(wl_list);
static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
@@ -3389,7 +3374,6 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
static struct ieee80211_hw *wl1271_alloc_hw(void)
{
struct ieee80211_hw *hw;
- struct platform_device *plat_dev = NULL;
struct wl1271 *wl;
int i, j, ret;
unsigned int order;
@@ -3401,20 +3385,12 @@ static struct ieee80211_hw *wl1271_alloc_hw(void)
goto err_hw_alloc;
}
- plat_dev = kmemdup(&wl1271_device, sizeof(wl1271_device), GFP_KERNEL);
- if (!plat_dev) {
- wl1271_error("could not allocate platform_device");
- ret = -ENOMEM;
- goto err_plat_alloc;
- }
-
wl = hw->priv;
memset(wl, 0, sizeof(*wl));
INIT_LIST_HEAD(&wl->list);
wl->hw = hw;
- wl->plat_dev = plat_dev;
for (i = 0; i < NUM_TX_QUEUES; i++)
skb_queue_head_init(&wl->tx_queue[i]);
@@ -3475,23 +3451,15 @@ static struct ieee80211_hw *wl1271_alloc_hw(void)
goto err_hw;
}
- /* Register platform device */
- ret = platform_device_register(wl->plat_dev);
- if (ret) {
- wl1271_error("couldn't register platform device");
- goto err_aggr;
- }
- dev_set_drvdata(&wl->plat_dev->dev, wl);
-
/* Create sysfs file to control bt coex state */
- ret = device_create_file(&wl->plat_dev->dev, &dev_attr_bt_coex_state);
+ ret = device_create_file(wl->dev, &dev_attr_bt_coex_state);
if (ret < 0) {
wl1271_error("failed to create sysfs file bt_coex_state");
- goto err_platform;
+ goto err_aggr;
}
/* Create sysfs file to get HW PG version */
- ret = device_create_file(&wl->plat_dev->dev, &dev_attr_hw_pg_ver);
+ ret = device_create_file(wl->dev, &dev_attr_hw_pg_ver);
if (ret < 0) {
wl1271_error("failed to create sysfs file hw_pg_ver");
goto err_bt_coex_state;
@@ -3500,19 +3468,13 @@ static struct ieee80211_hw *wl1271_alloc_hw(void)
return hw;
err_bt_coex_state:
- device_remove_file(&wl->plat_dev->dev, &dev_attr_bt_coex_state);
-
-err_platform:
- platform_device_unregister(wl->plat_dev);
+ device_remove_file(wl->dev, &dev_attr_bt_coex_state);
err_aggr:
free_pages((unsigned long)wl->aggr_buf, order);
err_hw:
wl1271_debugfs_exit(wl);
- kfree(plat_dev);
-
-err_plat_alloc:
ieee80211_free_hw(hw);
err_hw_alloc:
@@ -3522,10 +3484,8 @@ err_hw_alloc:
static int wl1271_free_hw(struct wl1271 *wl)
{
- platform_device_unregister(wl->plat_dev);
free_pages((unsigned long)wl->aggr_buf,
get_order(WL1271_AGGR_BUFFER_SIZE));
- kfree(wl->plat_dev);
wl1271_debugfs_exit(wl);
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index eb3d3fc..279bd82 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -339,7 +339,6 @@ struct wl1271_link {
};
struct wl1271 {
- struct platform_device *plat_dev;
struct ieee80211_hw *hw;
bool mac80211_registered;
--
1.7.4.1.343.ga91df
next prev parent reply other threads:[~2011-05-13 21:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-13 21:26 [RFC/PATCH 00/13] wl12xx re-factor Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 01/13] net: wl12xx: sdio: id_tables should be __devinitconst Felipe Balbi
2011-05-20 12:02 ` Luciano Coelho
2011-05-20 16:02 ` Ohad Ben-Cohen
2011-05-20 16:14 ` Michał Mirosław
2011-05-13 21:26 ` [RFC/PATCH 02/13] net: wl12xx: sdio: add a context structure Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 03/13] net: wl12xx: remove some unnecessary prints Felipe Balbi
2011-05-20 12:03 ` Luciano Coelho
2011-05-22 12:34 ` Eliad Peller
2011-05-22 12:37 ` Eliad Peller
2011-05-22 17:30 ` Luciano Coelho
2011-05-22 21:57 ` Eliad Peller
2011-05-23 5:32 ` Luciano Coelho
2011-05-23 6:07 ` Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 04/13] net: wl12xx: care for optional operations Felipe Balbi
2011-05-20 12:03 ` Luciano Coelho
2011-05-13 21:26 ` [RFC/PATCH 05/13] net: wl12xx: remove the nops Felipe Balbi
2011-05-20 12:04 ` Luciano Coelho
2011-05-13 21:26 ` [RFC/PATCH 06/13] net: wl12xx: remove unnecessary prints Felipe Balbi
2011-05-20 12:04 ` Luciano Coelho
2011-05-13 21:26 ` [RFC/PATCH 07/13] net: wl12xx: spi: add a context structure Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 08/13] net: wl12xx: spi: add a platform_device Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 09/13] net: wl12xx: sdio: " Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 10/13] net: wl12xx: main: add platform device Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 11/13] net: wireless: wl12xx: re-factor all drivers Felipe Balbi
2011-05-13 21:26 ` [RFC/PATCH 12/13] net: wireless: wl12xx: mark some symbols static Felipe Balbi
2011-05-13 21:26 ` Felipe Balbi [this message]
2011-05-19 12:49 ` [RFC/PATCH 00/13] wl12xx re-factor Luciano Coelho
2011-05-19 14:06 ` Felipe Balbi
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=1305321990-22041-14-git-send-email-balbi@ti.com \
--to=balbi@ti.com \
--cc=coelho@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).