Commit 16301861 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

mac802154: declare struct ieee802154_ops as const

The ieee802154_ops structure should be never changed during runtime.
This patch declare this structure as const to avoid a runtime change.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Cc: Alan Ott <alan@signal11.us>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 19ec690a
...@@ -1214,7 +1214,7 @@ at86rf230_set_frame_retries(struct ieee802154_hw *hw, s8 retries) ...@@ -1214,7 +1214,7 @@ at86rf230_set_frame_retries(struct ieee802154_hw *hw, s8 retries)
return rc; return rc;
} }
static struct ieee802154_ops at86rf230_ops = { static const struct ieee802154_ops at86rf230_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.xmit_async = at86rf230_xmit, .xmit_async = at86rf230_xmit,
.ed = at86rf230_ed, .ed = at86rf230_ed,
......
...@@ -631,7 +631,7 @@ cc2520_filter(struct ieee802154_hw *hw, ...@@ -631,7 +631,7 @@ cc2520_filter(struct ieee802154_hw *hw,
return 0; return 0;
} }
static struct ieee802154_ops cc2520_ops = { static const struct ieee802154_ops cc2520_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.start = cc2520_start, .start = cc2520_start,
.stop = cc2520_stop, .stop = cc2520_stop,
......
...@@ -129,7 +129,7 @@ fakelb_hw_stop(struct ieee802154_hw *hw) { ...@@ -129,7 +129,7 @@ fakelb_hw_stop(struct ieee802154_hw *hw) {
spin_unlock(&priv->lock); spin_unlock(&priv->lock);
} }
static struct ieee802154_ops fakelb_ops = { static const struct ieee802154_ops fakelb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.xmit_sync = fakelb_hw_xmit, .xmit_sync = fakelb_hw_xmit,
.ed = fakelb_hw_ed, .ed = fakelb_hw_ed,
......
...@@ -579,7 +579,7 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec) ...@@ -579,7 +579,7 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec)
return ret; return ret;
} }
static struct ieee802154_ops mrf24j40_ops = { static const struct ieee802154_ops mrf24j40_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.xmit_sync = mrf24j40_tx, .xmit_sync = mrf24j40_tx,
.ed = mrf24j40_ed, .ed = mrf24j40_ed,
......
...@@ -197,7 +197,7 @@ struct ieee802154_ops { ...@@ -197,7 +197,7 @@ struct ieee802154_ops {
/* Basic interface to register ieee802154 hwice */ /* Basic interface to register ieee802154 hwice */
struct ieee802154_hw * struct ieee802154_hw *
ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops); ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops);
void ieee802154_free_hw(struct ieee802154_hw *hw); void ieee802154_free_hw(struct ieee802154_hw *hw);
int ieee802154_register_hw(struct ieee802154_hw *hw); int ieee802154_register_hw(struct ieee802154_hw *hw);
void ieee802154_unregister_hw(struct ieee802154_hw *hw); void ieee802154_unregister_hw(struct ieee802154_hw *hw);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* mac802154 device private data */ /* mac802154 device private data */
struct ieee802154_local { struct ieee802154_local {
struct ieee802154_hw hw; struct ieee802154_hw hw;
struct ieee802154_ops *ops; const struct ieee802154_ops *ops;
/* ieee802154 phy */ /* ieee802154 phy */
struct wpan_phy *phy; struct wpan_phy *phy;
......
...@@ -187,7 +187,7 @@ static void ieee802154_tasklet_handler(unsigned long data) ...@@ -187,7 +187,7 @@ static void ieee802154_tasklet_handler(unsigned long data)
} }
struct ieee802154_hw * struct ieee802154_hw *
ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops) ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
{ {
struct wpan_phy *phy; struct wpan_phy *phy;
struct ieee802154_local *local; struct ieee802154_local *local;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment