From b2b41718b6b498754ccc6b2dd993d76f6c33ac93 Mon Sep 17 00:00:00 2001 From: Andrii Vladyka Date: Wed, 18 Oct 2017 16:23:45 +0300 Subject: staging: gdm724x: fix return codes in gdm_lte fix return codes in gdm_lte in gdm724x driver Signed-off-by: Andrii Vladyka Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gdm724x/gdm_lte.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/staging/gdm724x') diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c index 066b14ecc366..0527b0d1c1d0 100644 --- a/drivers/staging/gdm724x/gdm_lte.c +++ b/drivers/staging/gdm724x/gdm_lte.c @@ -246,13 +246,13 @@ static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type) if (ntohs(((struct ethhdr *)skb_in->data)->h_proto) == ETH_P_8021Q) { memcpy(&vlan_eth, skb_in->data, sizeof(struct vlan_ethhdr)); if (ntohs(vlan_eth.h_vlan_encapsulated_proto) != ETH_P_IPV6) - return -1; + return -EPROTONOSUPPORT; mac_header_data = &vlan_eth; mac_header_len = VLAN_ETH_HLEN; } else { memcpy(ð, skb_in->data, sizeof(struct ethhdr)); if (ntohs(eth.h_proto) != ETH_P_IPV6) - return -1; + return -EPROTONOSUPPORT; mac_header_data = ð mac_header_len = ETH_HLEN; } @@ -260,13 +260,13 @@ static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type) /* Check if this is IPv6 ICMP packet */ ipv6_in = (struct ipv6hdr *)(skb_in->data + mac_header_len); if (ipv6_in->version != 6 || ipv6_in->nexthdr != IPPROTO_ICMPV6) - return -1; + return -EPROTONOSUPPORT; /* Check if this is NDP packet */ icmp6_in = (struct icmp6hdr *)(skb_in->data + mac_header_len + sizeof(struct ipv6hdr)); if (icmp6_in->icmp6_type == NDISC_ROUTER_SOLICITATION) { /* Check RS */ - return -1; + return -EPROTONOSUPPORT; } else if (icmp6_in->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) { /* Check NS */ u8 icmp_na[sizeof(struct icmp6hdr) + @@ -310,7 +310,7 @@ static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type) icmp6_out.icmp6_cksum = icmp6_checksum(&ipv6_out, (u16 *)icmp_na, sizeof(icmp_na)); } else { - return -1; + return -EINVAL; } /* Fill the destination mac with source mac of the received packet */ @@ -417,7 +417,7 @@ static int gdm_lte_tx(struct sk_buff *skb, struct net_device *dev) nic_type = gdm_lte_tx_nic_type(dev, skb); if (nic_type == 0) { netdev_err(dev, "tx - invalid nic_type\n"); - return -1; + return -EMEDIUMTYPE; } if (nic_type & NIC_TYPE_ARP) { @@ -544,7 +544,7 @@ int gdm_lte_event_init(void) } pr_err("event init failed\n"); - return -1; + return -ENODATA; } void gdm_lte_event_exit(void) -- cgit v1.2.3-59-g8ed1b