diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-28 18:21:31 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-28 23:19:09 +0100 |
commit | 74457641558baded3c9f05bc3fb81293a2c02b2e (patch) | |
tree | 1c44bfe9006769028481efa56766b7e0de121a18 /net/mac802154 | |
parent | c7420c367d63a7e1414e010afb52c3837fd9134e (diff) | |
download | op-kernel-dev-74457641558baded3c9f05bc3fb81293a2c02b2e.zip op-kernel-dev-74457641558baded3c9f05bc3fb81293a2c02b2e.tar.gz |
mac802154: cleanup open count handling
This patch cleanups the open_count variable increment in open and close
calls of netdev.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r-- | net/mac802154/iface.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 1c0274e..c0bf5f9 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c @@ -166,19 +166,19 @@ static int mac802154_slave_open(struct net_device *dev) set_bit(SDATA_STATE_RUNNING, &sdata->state); - if (local->open_count++ == 0) { + if (!local->open_count) { res = drv_start(local); WARN_ON(res); if (res) goto err; } + local->open_count++; netif_start_queue(dev); return 0; err: /* might already be clear but that doesn't matter */ clear_bit(SDATA_STATE_RUNNING, &sdata->state); - sdata->local->open_count--; return res; } @@ -252,10 +252,11 @@ static int mac802154_slave_close(struct net_device *dev) ASSERT_RTNL(); netif_stop_queue(dev); + local->open_count--; clear_bit(SDATA_STATE_RUNNING, &sdata->state); - if (!--local->open_count) + if (!local->open_count) drv_stop(local); return 0; |