hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/net/ieee802154/cc2520.c
....@@ -1,14 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Driver for TI CC2520 802.15.4 Wireless-PAN Networking controller
23 *
34 * Copyright (C) 2014 Varka Bhadram <varkab@cdac.in>
45 * Md.Jamal Mohiuddin <mjmohiuddin@cdac.in>
56 * P Sowjanya <sowjanyap@cdac.in>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
127 */
138 #include <linux/kernel.h>
149 #include <linux/module.h>
....@@ -223,7 +218,6 @@
223218 cc2520_cmd_strobe(struct cc2520_private *priv, u8 cmd)
224219 {
225220 int ret;
226
- u8 status = 0xff;
227221 struct spi_message msg;
228222 struct spi_transfer xfer = {
229223 .len = 0,
....@@ -241,8 +235,6 @@
241235 priv->buf[0]);
242236
243237 ret = spi_sync(priv->spi, &msg);
244
- if (!ret)
245
- status = priv->buf[0];
246238 dev_vdbg(&priv->spi->dev,
247239 "buf[0] = %02x\n", priv->buf[0]);
248240 mutex_unlock(&priv->buffer_mutex);
....@@ -512,6 +504,7 @@
512504 goto err_tx;
513505
514506 if (status & CC2520_STATUS_TX_UNDERFLOW) {
507
+ rc = -EINVAL;
515508 dev_err(&priv->spi->dev, "cc2520 tx underflow exception\n");
516509 goto err_tx;
517510 }
....@@ -977,7 +970,7 @@
977970
978971 if (timeout-- <= 0) {
979972 dev_err(&priv->spi->dev, "oscillator start failed!\n");
980
- return ret;
973
+ return -ETIMEDOUT;
981974 }
982975 udelay(1);
983976 } while (!(status & CC2520_STATUS_XOSC32M_STABLE));