diff options
Diffstat (limited to 'drivers/net/can/at91_can.c')
-rw-r--r-- | drivers/net/can/at91_can.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index f67ae285a35a..cbe3fce53e3b 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
@@ -221,38 +221,6 @@ static inline void set_mb_mode(const struct at91_priv *priv, unsigned int mb, | |||
221 | set_mb_mode_prio(priv, mb, mode, 0); | 221 | set_mb_mode_prio(priv, mb, mode, 0); |
222 | } | 222 | } |
223 | 223 | ||
224 | static struct sk_buff *alloc_can_skb(struct net_device *dev, | ||
225 | struct can_frame **cf) | ||
226 | { | ||
227 | struct sk_buff *skb; | ||
228 | |||
229 | skb = netdev_alloc_skb(dev, sizeof(struct can_frame)); | ||
230 | if (unlikely(!skb)) | ||
231 | return NULL; | ||
232 | |||
233 | skb->protocol = htons(ETH_P_CAN); | ||
234 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
235 | *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame)); | ||
236 | |||
237 | return skb; | ||
238 | } | ||
239 | |||
240 | static struct sk_buff *alloc_can_err_skb(struct net_device *dev, | ||
241 | struct can_frame **cf) | ||
242 | { | ||
243 | struct sk_buff *skb; | ||
244 | |||
245 | skb = alloc_can_skb(dev, cf); | ||
246 | if (unlikely(!skb)) | ||
247 | return NULL; | ||
248 | |||
249 | memset(*cf, 0, sizeof(struct can_frame)); | ||
250 | (*cf)->can_id = CAN_ERR_FLAG; | ||
251 | (*cf)->can_dlc = CAN_ERR_DLC; | ||
252 | |||
253 | return skb; | ||
254 | } | ||
255 | |||
256 | /* | 224 | /* |
257 | * Swtich transceiver on or off | 225 | * Swtich transceiver on or off |
258 | */ | 226 | */ |
@@ -1087,7 +1055,7 @@ static int __init at91_can_probe(struct platform_device *pdev) | |||
1087 | goto exit_release; | 1055 | goto exit_release; |
1088 | } | 1056 | } |
1089 | 1057 | ||
1090 | dev = alloc_candev(sizeof(struct at91_priv)); | 1058 | dev = alloc_candev(sizeof(struct at91_priv), AT91_MB_TX_NUM); |
1091 | if (!dev) { | 1059 | if (!dev) { |
1092 | err = -ENOMEM; | 1060 | err = -ENOMEM; |
1093 | goto exit_iounmap; | 1061 | goto exit_iounmap; |