drivers: ieee802154: cc13xx_cc26xx: readability improvement

Aligns the name of the return value variable with what is used elsewhere
in the driver and the subsystem for improved readability and
consistency.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This commit is contained in:
Florian Grandel 2023-09-25 13:58:11 +02:00 committed by Chris Friedt
commit 7c00b81705

View file

@ -171,26 +171,20 @@ static inline int ieee802154_cc13xx_cc26xx_channel_to_frequency(
static int ieee802154_cc13xx_cc26xx_set_channel(const struct device *dev, static int ieee802154_cc13xx_cc26xx_set_channel(const struct device *dev,
uint16_t channel) uint16_t channel)
{ {
int r; int ret;
RF_CmdHandle cmd_handle; RF_CmdHandle cmd_handle;
RF_EventMask reason; RF_EventMask reason;
uint16_t freq, fract; uint16_t freq, fract;
struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data;
/* TODO Support sub-GHz for CC13xx */ ret = ieee802154_cc13xx_cc26xx_channel_to_frequency(channel, &freq, &fract);
if (channel < 11 || channel > 26) { if (ret < 0) {
return -EINVAL; return ret;
}
r = ieee802154_cc13xx_cc26xx_channel_to_frequency(
channel, &freq, &fract);
if (r < 0) {
return -EINVAL;
} }
/* Abort FG and BG processes */ /* Abort FG and BG processes */
if (ieee802154_cc13xx_cc26xx_stop(dev) < 0) { if (ieee802154_cc13xx_cc26xx_stop(dev) < 0) {
r = -EIO; ret = -EIO;
goto out; goto out;
} }
@ -205,7 +199,7 @@ static int ieee802154_cc13xx_cc26xx_set_channel(const struct device *dev,
RF_PriorityNormal, NULL, 0); RF_PriorityNormal, NULL, 0);
if (reason != RF_EventLastCmdDone) { if (reason != RF_EventLastCmdDone) {
LOG_ERR("Failed to set frequency: 0x%" PRIx64, reason); LOG_ERR("Failed to set frequency: 0x%" PRIx64, reason);
r = -EIO; ret = -EIO;
goto out; goto out;
} }
@ -217,15 +211,15 @@ static int ieee802154_cc13xx_cc26xx_set_channel(const struct device *dev,
cmd_ieee_rx_callback, RF_EventRxEntryDone); cmd_ieee_rx_callback, RF_EventRxEntryDone);
if (cmd_handle < 0) { if (cmd_handle < 0) {
LOG_ERR("Failed to post RX command (%d)", cmd_handle); LOG_ERR("Failed to post RX command (%d)", cmd_handle);
r = -EIO; ret = -EIO;
goto out; goto out;
} }
r = 0; ret = 0;
out: out:
k_mutex_unlock(&drv_data->tx_mutex); k_mutex_unlock(&drv_data->tx_mutex);
return r; return ret;
} }
/* TODO remove when rf driver bugfix is pulled in */ /* TODO remove when rf driver bugfix is pulled in */