Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[safe/jmp/linux-2.6] / drivers / net / wireless / rtl8180_max2820.c
index a34dfd3..6c825fd 100644 (file)
@@ -78,7 +78,8 @@ static void max2820_rf_set_channel(struct ieee80211_hw *dev,
                                   struct ieee80211_conf *conf)
 {
        struct rtl8180_priv *priv = dev->priv;
-       int channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
+       int channel = conf ?
+               ieee80211_frequency_to_channel(conf->channel->center_freq) : 1;
        unsigned int chan_idx = channel - 1;
        u32 txpw = priv->channels[chan_idx].hw_value & 0xFF;
        u32 chan = max2820_chan[chan_idx];
@@ -87,7 +88,7 @@ static void max2820_rf_set_channel(struct ieee80211_hw *dev,
         * sa2400, for MAXIM we do this directly from BB */
        rtl8180_write_phy(dev, 3, txpw);
 
-       max2820_write_phy_antenna(dev, chan);
+       max2820_write_phy_antenna(dev, channel);
        write_max2820(dev, 3, chan);
 }