Changeset d40cbce in freewrt for target/linux
- Timestamp:
- Jul 17, 2006, 5:06:35 AM (19 years ago)
- Branches:
- freewrt_1_0, freewrt_2_0
- Children:
- 83201d3
- Parents:
- 30d630b
- Location:
- target/linux/package/switch/src
- Files:
-
- 3 edited
-
switch-core.c (modified) (1 diff)
-
switch-core.h (modified) (1 diff)
-
switch-robo.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
target/linux/package/switch/src/switch-core.c
r30d630b rd40cbce 68 68 write: switch_proc_write 69 69 }; 70 71 static inline char *strdup(char *str) 72 { 73 char *new = kmalloc(strlen(str) + 1, GFP_KERNEL); 74 strcpy(new, str); 75 return new; 76 } 70 77 71 78 static ssize_t switch_proc_read(struct file *file, char *buf, size_t count, loff_t *ppos) -
target/linux/package/switch/src/switch-core.h
r30d630b rd40cbce 49 49 extern int switch_print_media(char *buf, int media); 50 50 51 static inline char *strdup(char *str)52 {53 char *new = kmalloc(strlen(str) + 1, GFP_KERNEL);54 strcpy(new, str);55 return new;56 }57 58 59 51 #endif -
target/linux/package/switch/src/switch-robo.c
r30d630b rd40cbce 52 52 #define SIOCSETCPHYWR (SIOCDEVPRIVATE + 10) 53 53 54 static char *device;55 54 static int use_et = 0; 56 55 static int is_5350 = 0; … … 315 314 } 316 315 } 317 316 318 317 buf[len] = '\0'; 319 318 … … 429 428 static int __init robo_init() 430 429 { 430 char *device = "ethX"; 431 431 int notfound = 1; 432 432 433 device = strdup("ethX");434 433 for (device[3] = '0'; (device[3] <= '3') && notfound; device[3]++) { 435 434 notfound = robo_probe(device); … … 437 436 device[3]--; 438 437 439 if (notfound) { 440 kfree(device); 438 if (notfound) 441 439 return -ENODEV; 442 }else {440 else { 443 441 switch_config cfg[] = { 444 442 {"enable", handle_enable_read, handle_enable_write}, … … 470 468 { 471 469 switch_unregister_driver(DRIVER_NAME); 472 kfree(device);473 470 } 474 471
Note:
See TracChangeset
for help on using the changeset viewer.
