From ffd2d9bdac1a0a5d3184e085ea1bd3060b4166fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 29 Mar 2010 00:53:14 +0200 Subject: [PATCH] b43: N-PHY: find table entry earlier for setting chanspec MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We do not want to partially change chanspec just to find out there is not entry in table for given channel. Signed-off-by: Rafał Miłecki Signed-off-by: John W. Linville --- drivers/net/wireless/b43/phy_n.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 052119b84da4..d9e47ba5e157 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c @@ -3343,6 +3343,10 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev, if (dev->phy.rev >= 3) { /* TODO */ + } else { + tabent = b43_nphy_get_chantabent(dev, channel); + if (!tabent) + return -ESRCH; } nphy->radio_chanspec = chanspec; @@ -3366,10 +3370,6 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev, /* TODO: PHY Radio2056 Setup (chan_info_ptr[i]) */ /* TODO: N PHY Chanspec Setup (chan_info_ptr[i]) */ } else { - tabent = b43_nphy_get_chantabent(dev, channel); - if (!tabent) - return -ESRCH; - tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050; b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp); b43_radio_2055_setup(dev, tabent); -- 2.20.1