summaryrefslogtreecommitdiff
path: root/drivers/net/ieee802154/cc2520.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ieee802154/cc2520.c')
-rw-r--r--drivers/net/ieee802154/cc2520.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index d50add705a79..0c89d3edf901 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -517,7 +517,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
}
spin_lock_irqsave(&priv->lock, flags);
- BUG_ON(priv->is_tx);
+ WARN_ON(priv->is_tx);
priv->is_tx = 1;
spin_unlock_irqrestore(&priv->lock, flags);
@@ -643,12 +643,12 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
dev_dbg(&priv->spi->dev, "trying to set channel\n");
- BUG_ON(page != 0);
- BUG_ON(channel < CC2520_MINCHANNEL);
- BUG_ON(channel > CC2520_MAXCHANNEL);
+ WARN_ON(page != 0);
+ WARN_ON(channel < CC2520_MINCHANNEL);
+ WARN_ON(channel > CC2520_MAXCHANNEL);
ret = cc2520_write_register(priv, CC2520_FREQCTRL,
- 11 + 5*(channel - 11));
+ 11 + 5 * (channel - 11));
return ret;
}
@@ -663,15 +663,14 @@ cc2520_filter(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_PANID_CHANGED) {
u16 panid = le16_to_cpu(filt->pan_id);
- dev_vdbg(&priv->spi->dev,
- "cc2520_filter called for pan id\n");
+ dev_vdbg(&priv->spi->dev, "%s called for pan id\n", __func__);
ret = cc2520_write_ram(priv, CC2520RAM_PANID,
sizeof(panid), (u8 *)&panid);
}
if (changed & IEEE802154_AFILT_IEEEADDR_CHANGED) {
dev_vdbg(&priv->spi->dev,
- "cc2520_filter called for IEEE addr\n");
+ "%s called for IEEE addr\n", __func__);
ret = cc2520_write_ram(priv, CC2520RAM_IEEEADDR,
sizeof(filt->ieee_addr),
(u8 *)&filt->ieee_addr);
@@ -680,8 +679,7 @@ cc2520_filter(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
u16 addr = le16_to_cpu(filt->short_addr);
- dev_vdbg(&priv->spi->dev,
- "cc2520_filter called for saddr\n");
+ dev_vdbg(&priv->spi->dev, "%s called for saddr\n", __func__);
ret = cc2520_write_ram(priv, CC2520RAM_SHORTADDR,
sizeof(addr), (u8 *)&addr);
}
@@ -690,7 +688,7 @@ cc2520_filter(struct ieee802154_hw *hw,
u8 frmfilt0;
dev_vdbg(&priv->spi->dev,
- "cc2520_filter called for panc change\n");
+ "%s called for panc change\n", __func__);
cc2520_read_register(priv, CC2520_FRMFILT0, &frmfilt0);
@@ -929,6 +927,7 @@ static int cc2520_get_platform_data(struct spi_device *spi,
if (!np) {
struct cc2520_platform_data *spi_pdata = spi->dev.platform_data;
+
if (!spi_pdata)
return -ENOENT;
*pdata = *spi_pdata;