Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arcnet: arc-rawmode: reorder module functions

This patch moves the module_init and module_exit patches to
the end of the file. It also replaces the printk with pr_info.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

+38 -46
+38 -46
drivers/net/arcnet/arc-rawmode.c
··· 33 33 #include <net/arp.h> 34 34 #include <linux/netdevice.h> 35 35 #include <linux/skbuff.h> 36 - 37 36 #include "arcdevice.h" 38 - 39 - static void rx(struct net_device *dev, int bufnum, 40 - struct archdr *pkthdr, int length); 41 - static int build_header(struct sk_buff *skb, struct net_device *dev, 42 - unsigned short type, uint8_t daddr); 43 - static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, 44 - int bufnum); 45 - 46 - static struct ArcProto rawmode_proto = { 47 - .suffix = 'r', 48 - .mtu = XMTU, 49 - .rx = rx, 50 - .build_header = build_header, 51 - .prepare_tx = prepare_tx, 52 - .continue_tx = NULL, 53 - .ack_tx = NULL 54 - }; 55 - 56 - static int __init arcnet_raw_init(void) 57 - { 58 - int count; 59 - 60 - pr_info("%s\n", "raw mode (`r') encapsulation support loaded"); 61 - 62 - for (count = 0; count < 256; count++) 63 - if (arc_proto_map[count] == arc_proto_default) 64 - arc_proto_map[count] = &rawmode_proto; 65 - 66 - /* for raw mode, we only set the bcast proto if there's no better one */ 67 - if (arc_bcast_proto == arc_proto_default) 68 - arc_bcast_proto = &rawmode_proto; 69 - 70 - arc_proto_default = &rawmode_proto; 71 - return 0; 72 - } 73 - 74 - static void __exit arcnet_raw_exit(void) 75 - { 76 - arcnet_unregister_proto(&rawmode_proto); 77 - } 78 - 79 - module_init(arcnet_raw_init); 80 - module_exit(arcnet_raw_exit); 81 - 82 - MODULE_LICENSE("GPL"); 83 37 84 38 /* packet receiver */ 85 39 static void rx(struct net_device *dev, int bufnum, ··· 149 195 150 196 return 1; /* done */ 151 197 } 198 + 199 + static struct ArcProto rawmode_proto = { 200 + .suffix = 'r', 201 + .mtu = XMTU, 202 + .rx = rx, 203 + .build_header = build_header, 204 + .prepare_tx = prepare_tx, 205 + .continue_tx = NULL, 206 + .ack_tx = NULL 207 + }; 208 + 209 + static int __init arcnet_raw_init(void) 210 + { 211 + int count; 212 + 213 + pr_info("raw mode (`r') encapsulation support loaded\n"); 214 + 215 + for (count = 0; count < 256; count++) 216 + if (arc_proto_map[count] == arc_proto_default) 217 + arc_proto_map[count] = &rawmode_proto; 218 + 219 + /* for raw mode, we only set the bcast proto if there's no better one */ 220 + if (arc_bcast_proto == arc_proto_default) 221 + arc_bcast_proto = &rawmode_proto; 222 + 223 + arc_proto_default = &rawmode_proto; 224 + return 0; 225 + } 226 + 227 + static void __exit arcnet_raw_exit(void) 228 + { 229 + arcnet_unregister_proto(&rawmode_proto); 230 + } 231 + 232 + module_init(arcnet_raw_init); 233 + module_exit(arcnet_raw_exit); 234 + 235 + MODULE_LICENSE("GPL");