This patch moves the check on channels_supported out of softmac implementation. We can and should do that earlier in nl802154 implementation. Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx> --- net/ieee802154/nl802154.c | 4 ++++ net/mac802154/cfg.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 4172e21..4ea64ef 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -628,6 +628,10 @@ static int nl802154_set_channel(struct sk_buff *skb, struct genl_info *info) if (page > IEEE802154_MAX_PAGE || channel > IEEE802154_MAX_CHANNEL) return -EINVAL; + /* check if phy support this setting */ + if (!(rdev->wpan_phy.supported.channels[page] & BIT(channel))) + return -EINVAL; + return rdev_set_channel(rdev, page, channel); } diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c index 191143a..d8bb593 100644 --- a/net/mac802154/cfg.c +++ b/net/mac802154/cfg.c @@ -70,10 +70,6 @@ ieee802154_set_channel(struct wpan_phy *wpan_phy, u8 page, u8 channel) ASSERT_RTNL(); - /* check if phy support this setting */ - if (!(wpan_phy->supported.channels[page] & BIT(channel))) - return -EINVAL; - ret = drv_set_channel(local, page, channel); if (!ret) { wpan_phy->current_page = page; -- 2.3.5 -- To unsubscribe from this list: send the line "unsubscribe linux-wpan" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html