| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* Driver for TI CC2520 802.15.4 Wireless-PAN Networking controller |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2014 Varka Bhadram <varkab@cdac.in> |
|---|
| 4 | 5 | * Md.Jamal Mohiuddin <mjmohiuddin@cdac.in> |
|---|
| 5 | 6 | * 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 | | - * |
|---|
| 12 | 7 | */ |
|---|
| 13 | 8 | #include <linux/kernel.h> |
|---|
| 14 | 9 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 223 | 218 | cc2520_cmd_strobe(struct cc2520_private *priv, u8 cmd) |
|---|
| 224 | 219 | { |
|---|
| 225 | 220 | int ret; |
|---|
| 226 | | - u8 status = 0xff; |
|---|
| 227 | 221 | struct spi_message msg; |
|---|
| 228 | 222 | struct spi_transfer xfer = { |
|---|
| 229 | 223 | .len = 0, |
|---|
| .. | .. |
|---|
| 241 | 235 | priv->buf[0]); |
|---|
| 242 | 236 | |
|---|
| 243 | 237 | ret = spi_sync(priv->spi, &msg); |
|---|
| 244 | | - if (!ret) |
|---|
| 245 | | - status = priv->buf[0]; |
|---|
| 246 | 238 | dev_vdbg(&priv->spi->dev, |
|---|
| 247 | 239 | "buf[0] = %02x\n", priv->buf[0]); |
|---|
| 248 | 240 | mutex_unlock(&priv->buffer_mutex); |
|---|
| .. | .. |
|---|
| 512 | 504 | goto err_tx; |
|---|
| 513 | 505 | |
|---|
| 514 | 506 | if (status & CC2520_STATUS_TX_UNDERFLOW) { |
|---|
| 507 | + rc = -EINVAL; |
|---|
| 515 | 508 | dev_err(&priv->spi->dev, "cc2520 tx underflow exception\n"); |
|---|
| 516 | 509 | goto err_tx; |
|---|
| 517 | 510 | } |
|---|
| .. | .. |
|---|
| 977 | 970 | |
|---|
| 978 | 971 | if (timeout-- <= 0) { |
|---|
| 979 | 972 | dev_err(&priv->spi->dev, "oscillator start failed!\n"); |
|---|
| 980 | | - return ret; |
|---|
| 973 | + return -ETIMEDOUT; |
|---|
| 981 | 974 | } |
|---|
| 982 | 975 | udelay(1); |
|---|
| 983 | 976 | } while (!(status & CC2520_STATUS_XOSC32M_STABLE)); |
|---|