ieee802165: Device driver_api is const, honour it.

Change-Id: I6aebffb8abc52013c626e3c67c8c4f1f529932e0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
This commit is contained in:
Marcus Shawcroft 2016-12-20 10:29:52 +00:00 committed by Anas Nashif
commit 531cb01c19
3 changed files with 6 additions and 8 deletions

View file

@ -112,8 +112,8 @@ static inline void ieee802154_acknowledge(struct net_if *iface,
net_nbuf_set_ll_reserve(buf, net_buf_headroom(frag));
if (ieee802154_create_ack_frame(iface, buf, mpdu->mhr.fs->sequence)) {
struct ieee802154_radio_api *radio =
(struct ieee802154_radio_api *)iface->dev->driver_api;
const struct ieee802154_radio_api *radio =
iface->dev->driver_api;
net_buf_add(frag, IEEE802154_ACK_PKT_LENGTH);
@ -325,8 +325,8 @@ NET_L2_INIT(IEEE802154_L2,
void ieee802154_init(struct net_if *iface)
{
struct ieee802154_radio_api *radio =
(struct ieee802154_radio_api *)iface->dev->driver_api;
const struct ieee802154_radio_api *radio =
iface->dev->driver_api;
NET_DBG("Initializing IEEE 802.15.4 stack on iface %p", iface);

View file

@ -35,8 +35,7 @@ static inline int aloha_tx_fragment(struct net_if *iface,
uint8_t retries = CONFIG_NET_L2_IEEE802154_RADIO_TX_RETRIES;
struct ieee802154_context *ctx = net_if_l2_data(iface);
bool ack_required = prepare_for_ack(ctx, buf);
struct ieee802154_radio_api *radio =
(struct ieee802154_radio_api *)iface->dev->driver_api;
const struct ieee802154_radio_api *radio = iface->dev->driver_api;
int ret = -EIO;
NET_DBG("frag %p", buf->frags);

View file

@ -39,8 +39,7 @@ static inline int csma_ca_tx_fragment(struct net_if *iface,
const uint8_t max_be = CONFIG_NET_L2_IEEE802154_RADIO_CSMA_CA_MAX_BE;
uint8_t retries = CONFIG_NET_L2_IEEE802154_RADIO_TX_RETRIES;
struct ieee802154_context *ctx = net_if_l2_data(iface);
struct ieee802154_radio_api *radio =
(struct ieee802154_radio_api *)iface->dev->driver_api;
const struct ieee802154_radio_api *radio = iface->dev->driver_api;
bool ack_required = prepare_for_ack(ctx, buf);
uint8_t be = CONFIG_NET_L2_IEEE802154_RADIO_CSMA_CA_MIN_BE;
uint8_t nb = 0;