From 7c00b81705707085e37641ab7bd64d554cce4ccc Mon Sep 17 00:00:00 2001 From: Florian Grandel Date: Mon, 25 Sep 2023 13:58:11 +0200 Subject: [PATCH] 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 --- drivers/ieee802154/ieee802154_cc13xx_cc26xx.c | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c b/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c index 2068e08a475..95db189fb6d 100644 --- a/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c +++ b/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c @@ -171,26 +171,20 @@ static inline int ieee802154_cc13xx_cc26xx_channel_to_frequency( static int ieee802154_cc13xx_cc26xx_set_channel(const struct device *dev, uint16_t channel) { - int r; + int ret; RF_CmdHandle cmd_handle; RF_EventMask reason; uint16_t freq, fract; struct ieee802154_cc13xx_cc26xx_data *drv_data = dev->data; - /* TODO Support sub-GHz for CC13xx */ - if (channel < 11 || channel > 26) { - return -EINVAL; - } - - r = ieee802154_cc13xx_cc26xx_channel_to_frequency( - channel, &freq, &fract); - if (r < 0) { - return -EINVAL; + ret = ieee802154_cc13xx_cc26xx_channel_to_frequency(channel, &freq, &fract); + if (ret < 0) { + return ret; } /* Abort FG and BG processes */ if (ieee802154_cc13xx_cc26xx_stop(dev) < 0) { - r = -EIO; + ret = -EIO; goto out; } @@ -205,7 +199,7 @@ static int ieee802154_cc13xx_cc26xx_set_channel(const struct device *dev, RF_PriorityNormal, NULL, 0); if (reason != RF_EventLastCmdDone) { LOG_ERR("Failed to set frequency: 0x%" PRIx64, reason); - r = -EIO; + ret = -EIO; goto out; } @@ -217,15 +211,15 @@ static int ieee802154_cc13xx_cc26xx_set_channel(const struct device *dev, cmd_ieee_rx_callback, RF_EventRxEntryDone); if (cmd_handle < 0) { LOG_ERR("Failed to post RX command (%d)", cmd_handle); - r = -EIO; + ret = -EIO; goto out; } - r = 0; + ret = 0; out: k_mutex_unlock(&drv_data->tx_mutex); - return r; + return ret; } /* TODO remove when rf driver bugfix is pulled in */