mac802154: fix transmission power datatype
[deliverable/linux.git] / drivers / net / ieee802154 / at86rf230.c
index 795106c230978492e6c505d3cef2afacd47700ed..38026650c0387ecb101d085e24273bf24ded2783 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/irq.h>
 #include <linux/gpio.h>
 #include <linux/delay.h>
-#include <linux/spinlock.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/at86rf230.h>
 #include <linux/regmap.h>
@@ -96,8 +95,6 @@ struct at86rf230_local {
        unsigned long cal_timeout;
        s8 max_frame_retries;
        bool is_tx;
-       /* spinlock for is_tx protection */
-       spinlock_t lock;
        u8 tx_retry;
        struct sk_buff *tx_skb;
        struct at86rf230_state_change tx;
@@ -325,7 +322,7 @@ at86rf230_read_subreg(struct at86rf230_local *lp,
        int rc;
 
        rc = __at86rf230_read(lp, addr, data);
-       if (rc > 0)
+       if (!rc)
                *data = (*data & mask) >> shift;
 
        return rc;
@@ -421,6 +418,8 @@ at86rf230_reg_volatile(struct device *dev, unsigned int reg)
        case RG_PHY_ED_LEVEL:
        case RG_IRQ_STATUS:
        case RG_VREG_CTRL:
+       case RG_PLL_CF:
+       case RG_PLL_DCU:
                return true;
        default:
                return false;
@@ -458,6 +457,7 @@ at86rf230_async_error_recover(void *context)
        struct at86rf230_state_change *ctx = context;
        struct at86rf230_local *lp = ctx->lp;
 
+       lp->is_tx = 0;
        at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON, NULL, false);
        ieee802154_wake_queue(lp->hw);
 }
@@ -876,10 +876,8 @@ at86rf230_rx_trac_check(void *context)
 static void
 at86rf230_irq_trx_end(struct at86rf230_local *lp)
 {
-       spin_lock(&lp->lock);
        if (lp->is_tx) {
                lp->is_tx = 0;
-               spin_unlock(&lp->lock);
 
                if (lp->tx_aret)
                        at86rf230_async_state_change(lp, &lp->irq,
@@ -892,7 +890,6 @@ at86rf230_irq_trx_end(struct at86rf230_local *lp)
                                                     at86rf230_tx_complete,
                                                     true);
        } else {
-               spin_unlock(&lp->lock);
                at86rf230_async_read_reg(lp, RG_TRX_STATE, &lp->irq,
                                         at86rf230_rx_trac_check, true);
        }
@@ -962,9 +959,7 @@ at86rf230_write_frame(void *context)
        u8 *buf = ctx->buf;
        int rc;
 
-       spin_lock(&lp->lock);
        lp->is_tx = 1;
-       spin_unlock(&lp->lock);
 
        buf[0] = CMD_FB | CMD_WRITE;
        buf[1] = skb->len + 2;
@@ -1178,7 +1173,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
 }
 
 static int
-at86rf230_set_txpower(struct ieee802154_hw *hw, int db)
+at86rf230_set_txpower(struct ieee802154_hw *hw, s8 db)
 {
        struct at86rf230_local *lp = hw->priv;
 
@@ -1696,7 +1691,6 @@ static int at86rf230_probe(struct spi_device *spi)
        if (rc < 0)
                goto free_dev;
 
-       spin_lock_init(&lp->lock);
        init_completion(&lp->state_complete);
 
        spi_set_drvdata(spi, lp);
This page took 0.025755 seconds and 5 git commands to generate.