diff options
Diffstat (limited to 'net/ieee802154/nl-phy.c')
| -rw-r--r-- | net/ieee802154/nl-phy.c | 43 | 
1 files changed, 8 insertions, 35 deletions
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index 22b1a7058fd..89b265aea15 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c @@ -77,8 +77,7 @@ out:  	return -EMSGSIZE;  } -static int ieee802154_list_phy(struct sk_buff *skb, -	struct genl_info *info) +int ieee802154_list_phy(struct sk_buff *skb, struct genl_info *info)  {  	/* Request for interface name, index, type, IEEE address,  	   PAN Id, short address */ @@ -151,8 +150,7 @@ static int ieee802154_dump_phy_iter(struct wpan_phy *phy, void *_data)  	return 0;  } -static int ieee802154_dump_phy(struct sk_buff *skb, -	struct netlink_callback *cb) +int ieee802154_dump_phy(struct sk_buff *skb, struct netlink_callback *cb)  {  	struct dump_phy_data data = {  		.cb = cb, @@ -170,8 +168,7 @@ static int ieee802154_dump_phy(struct sk_buff *skb,  	return skb->len;  } -static int ieee802154_add_iface(struct sk_buff *skb, -		struct genl_info *info) +int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)  {  	struct sk_buff *msg;  	struct wpan_phy *phy; @@ -224,8 +221,10 @@ static int ieee802154_add_iface(struct sk_buff *skb,  	if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) {  		type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]); -		if (type >= __IEEE802154_DEV_MAX) -			return -EINVAL; +		if (type >= __IEEE802154_DEV_MAX) { +			rc = -EINVAL; +			goto nla_put_failure; +		}  	}  	dev = phy->add_iface(phy, devname, type); @@ -273,8 +272,7 @@ out_dev:  	return rc;  } -static int ieee802154_del_iface(struct sk_buff *skb, -		struct genl_info *info) +int ieee802154_del_iface(struct sk_buff *skb, struct genl_info *info)  {  	struct sk_buff *msg;  	struct wpan_phy *phy; @@ -356,28 +354,3 @@ out_dev:  	return rc;  } - -static struct genl_ops ieee802154_phy_ops[] = { -	IEEE802154_DUMP(IEEE802154_LIST_PHY, ieee802154_list_phy, -							ieee802154_dump_phy), -	IEEE802154_OP(IEEE802154_ADD_IFACE, ieee802154_add_iface), -	IEEE802154_OP(IEEE802154_DEL_IFACE, ieee802154_del_iface), -}; - -/* - * No need to unregister as family unregistration will do it. - */ -int nl802154_phy_register(void) -{ -	int i; -	int rc; - -	for (i = 0; i < ARRAY_SIZE(ieee802154_phy_ops); i++) { -		rc = genl_register_ops(&nl802154_family, -				&ieee802154_phy_ops[i]); -		if (rc) -			return rc; -	} - -	return 0; -}  | 
