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

Configure Feed

Select the types of activity you want to include in your feed.

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Handle ISA devices with no 'regs' property.
[SPARC64]: Update defconfig.
[SPARC64]: Fix of_iounmap() region release.
[SPARC64]: Fix "mem=xxx" handling.

+313 -155
+1 -1
arch/sparc/kernel/ioport.c
··· 153 153 } 154 154 EXPORT_SYMBOL(of_ioremap); 155 155 156 - void of_iounmap(void __iomem *base, unsigned long size) 156 + void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) 157 157 { 158 158 iounmap(base); 159 159 }
+26 -8
arch/sparc64/defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.19 4 - # Sat Dec 9 15:41:30 2006 3 + # Linux kernel version: 2.6.20-rc2 4 + # Thu Dec 28 15:09:49 2006 5 5 # 6 6 CONFIG_SPARC=y 7 7 CONFIG_SPARC64=y ··· 334 334 CONFIG_BLK_DEV_CRYPTOLOOP=m 335 335 CONFIG_BLK_DEV_NBD=m 336 336 # CONFIG_BLK_DEV_SX8 is not set 337 - CONFIG_BLK_DEV_UB=m 337 + # CONFIG_BLK_DEV_UB is not set 338 338 # CONFIG_BLK_DEV_RAM is not set 339 339 # CONFIG_BLK_DEV_INITRD is not set 340 340 CONFIG_CDROM_PKTCDVD=m ··· 840 840 # CONFIG_SENSORS_LM92 is not set 841 841 # CONFIG_SENSORS_MAX1619 is not set 842 842 # CONFIG_SENSORS_PC87360 is not set 843 + # CONFIG_SENSORS_PC87427 is not set 843 844 # CONFIG_SENSORS_SIS5595 is not set 844 845 # CONFIG_SENSORS_SMSC47M1 is not set 845 846 # CONFIG_SENSORS_SMSC47M192 is not set ··· 851 850 # CONFIG_SENSORS_W83781D is not set 852 851 # CONFIG_SENSORS_W83791D is not set 853 852 # CONFIG_SENSORS_W83792D is not set 853 + # CONFIG_SENSORS_W83793 is not set 854 854 # CONFIG_SENSORS_W83L785TS is not set 855 855 # CONFIG_SENSORS_W83627HF is not set 856 856 # CONFIG_SENSORS_W83627EHF is not set ··· 964 962 # 965 963 CONFIG_SND_MPU401_UART=m 966 964 CONFIG_SND_AC97_CODEC=m 967 - CONFIG_SND_AC97_BUS=m 968 965 CONFIG_SND_DUMMY=m 969 966 CONFIG_SND_VIRMIDI=m 970 967 CONFIG_SND_MTPAV=m ··· 1046 1045 # Open Sound System 1047 1046 # 1048 1047 # CONFIG_SOUND_PRIME is not set 1048 + CONFIG_AC97_BUS=m 1049 1049 1050 1050 # 1051 1051 # HID Devices ··· 1098 1096 # 1099 1097 # may also be needed; see USB_STORAGE Help for more information 1100 1098 # 1101 - # CONFIG_USB_STORAGE is not set 1099 + CONFIG_USB_STORAGE=m 1100 + # CONFIG_USB_STORAGE_DEBUG is not set 1101 + # CONFIG_USB_STORAGE_DATAFAB is not set 1102 + # CONFIG_USB_STORAGE_FREECOM is not set 1103 + # CONFIG_USB_STORAGE_ISD200 is not set 1104 + # CONFIG_USB_STORAGE_DPCM is not set 1105 + # CONFIG_USB_STORAGE_USBAT is not set 1106 + # CONFIG_USB_STORAGE_SDDR09 is not set 1107 + # CONFIG_USB_STORAGE_SDDR55 is not set 1108 + # CONFIG_USB_STORAGE_JUMPSHOT is not set 1109 + # CONFIG_USB_STORAGE_ALAUDA is not set 1110 + # CONFIG_USB_STORAGE_ONETOUCH is not set 1111 + # CONFIG_USB_STORAGE_KARMA is not set 1102 1112 # CONFIG_USB_LIBUSUAL is not set 1103 1113 1104 1114 # ··· 1233 1219 1234 1220 # 1235 1221 # DMA Devices 1222 + # 1223 + 1224 + # 1225 + # Virtualization 1236 1226 # 1237 1227 1238 1228 # ··· 1415 1397 CONFIG_ENABLE_MUST_CHECK=y 1416 1398 CONFIG_MAGIC_SYSRQ=y 1417 1399 # CONFIG_UNUSED_SYMBOLS is not set 1400 + CONFIG_DEBUG_FS=y 1401 + # CONFIG_HEADERS_CHECK is not set 1418 1402 CONFIG_DEBUG_KERNEL=y 1419 1403 CONFIG_LOG_BUF_SHIFT=18 1420 1404 CONFIG_DETECT_SOFTLOCKUP=y ··· 1434 1414 # CONFIG_DEBUG_KOBJECT is not set 1435 1415 CONFIG_DEBUG_BUGVERBOSE=y 1436 1416 # CONFIG_DEBUG_INFO is not set 1437 - CONFIG_DEBUG_FS=y 1438 1417 # CONFIG_DEBUG_VM is not set 1439 1418 # CONFIG_DEBUG_LIST is not set 1440 - # CONFIG_UNWIND_INFO is not set 1441 1419 CONFIG_FORCED_INLINING=y 1442 - # CONFIG_HEADERS_CHECK is not set 1443 1420 # CONFIG_RCU_TORTURE_TEST is not set 1444 1421 # CONFIG_LKDTM is not set 1445 1422 # CONFIG_DEBUG_STACK_USAGE is not set ··· 1506 1489 CONFIG_ZLIB_INFLATE=y 1507 1490 CONFIG_ZLIB_DEFLATE=y 1508 1491 CONFIG_PLIST=y 1492 + CONFIG_IOMAP_COPY=y
+8 -12
arch/sparc64/kernel/isa.c
··· 22 22 printk(" [%s", isa_dev->prom_node->name); 23 23 } 24 24 25 - static struct linux_prom_registers * __init 26 - isa_dev_get_resource(struct sparc_isa_device *isa_dev) 25 + static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev) 27 26 { 28 27 struct linux_prom_registers *pregs; 29 28 unsigned long base, len; 30 29 int prop_len; 31 30 32 31 pregs = of_get_property(isa_dev->prom_node, "reg", &prop_len); 32 + if (!pregs) 33 + return; 33 34 34 35 /* Only the first one is interesting. */ 35 36 len = pregs[0].reg_size; ··· 45 44 46 45 request_resource(&isa_dev->bus->parent->io_space, 47 46 &isa_dev->resource); 48 - 49 - return pregs; 50 47 } 51 48 52 - static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev, 53 - struct linux_prom_registers *pregs) 49 + static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev) 54 50 { 55 51 struct of_device *op = of_find_device_by_node(isa_dev->prom_node); 56 52 ··· 67 69 68 70 printk(" ->"); 69 71 while (dp) { 70 - struct linux_prom_registers *regs; 71 72 struct sparc_isa_device *isa_dev; 72 73 73 74 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); ··· 82 85 isa_dev->bus = parent_isa_dev->bus; 83 86 isa_dev->prom_node = dp; 84 87 85 - regs = isa_dev_get_resource(isa_dev); 86 - isa_dev_get_irq(isa_dev, regs); 88 + isa_dev_get_resource(isa_dev); 89 + isa_dev_get_irq(isa_dev); 87 90 88 91 report_dev(isa_dev, 1); 89 92 ··· 96 99 struct device_node *dp = isa_br->prom_node->child; 97 100 98 101 while (dp) { 99 - struct linux_prom_registers *regs; 100 102 struct sparc_isa_device *isa_dev; 101 103 102 104 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); ··· 133 137 isa_dev->bus = isa_br; 134 138 isa_dev->prom_node = dp; 135 139 136 - regs = isa_dev_get_resource(isa_dev); 137 - isa_dev_get_irq(isa_dev, regs); 140 + isa_dev_get_resource(isa_dev); 141 + isa_dev_get_irq(isa_dev); 138 142 139 143 report_dev(isa_dev, 0); 140 144
+5 -2
arch/sparc64/kernel/of_device.c
··· 144 144 } 145 145 EXPORT_SYMBOL(of_ioremap); 146 146 147 - void of_iounmap(void __iomem *base, unsigned long size) 147 + void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) 148 148 { 149 - release_region((unsigned long) base, size); 149 + if (res->flags & IORESOURCE_MEM) 150 + release_mem_region((unsigned long) base, size); 151 + else 152 + release_region((unsigned long) base, size); 150 153 } 151 154 EXPORT_SYMBOL(of_iounmap); 152 155
+124 -23
arch/sparc64/mm/init.c
··· 872 872 prom_halt(); 873 873 } 874 874 875 + static void __init trim_pavail(unsigned long *cur_size_p, 876 + unsigned long *end_of_phys_p) 877 + { 878 + unsigned long to_trim = *cur_size_p - cmdline_memory_size; 879 + unsigned long avoid_start, avoid_end; 880 + int i; 881 + 882 + to_trim = PAGE_ALIGN(to_trim); 883 + 884 + avoid_start = avoid_end = 0; 885 + #ifdef CONFIG_BLK_DEV_INITRD 886 + avoid_start = initrd_start; 887 + avoid_end = PAGE_ALIGN(initrd_end); 888 + #endif 889 + 890 + /* Trim some pavail[] entries in order to satisfy the 891 + * requested "mem=xxx" kernel command line specification. 892 + * 893 + * We must not trim off the kernel image area nor the 894 + * initial ramdisk range (if any). Also, we must not trim 895 + * any pavail[] entry down to zero in order to preserve 896 + * the invariant that all pavail[] entries have a non-zero 897 + * size which is assumed by all of the code in here. 898 + */ 899 + for (i = 0; i < pavail_ents; i++) { 900 + unsigned long start, end, kern_end; 901 + unsigned long trim_low, trim_high, n; 902 + 903 + kern_end = PAGE_ALIGN(kern_base + kern_size); 904 + 905 + trim_low = start = pavail[i].phys_addr; 906 + trim_high = end = start + pavail[i].reg_size; 907 + 908 + if (kern_base >= start && 909 + kern_base < end) { 910 + trim_low = kern_base; 911 + if (kern_end >= end) 912 + continue; 913 + } 914 + if (kern_end >= start && 915 + kern_end < end) { 916 + trim_high = kern_end; 917 + } 918 + if (avoid_start && 919 + avoid_start >= start && 920 + avoid_start < end) { 921 + if (trim_low > avoid_start) 922 + trim_low = avoid_start; 923 + if (avoid_end >= end) 924 + continue; 925 + } 926 + if (avoid_end && 927 + avoid_end >= start && 928 + avoid_end < end) { 929 + if (trim_high < avoid_end) 930 + trim_high = avoid_end; 931 + } 932 + 933 + if (trim_high <= trim_low) 934 + continue; 935 + 936 + if (trim_low == start && trim_high == end) { 937 + /* Whole chunk is available for trimming. 938 + * Trim all except one page, in order to keep 939 + * entry non-empty. 940 + */ 941 + n = (end - start) - PAGE_SIZE; 942 + if (n > to_trim) 943 + n = to_trim; 944 + 945 + if (n) { 946 + pavail[i].phys_addr += n; 947 + pavail[i].reg_size -= n; 948 + to_trim -= n; 949 + } 950 + } else { 951 + n = (trim_low - start); 952 + if (n > to_trim) 953 + n = to_trim; 954 + 955 + if (n) { 956 + pavail[i].phys_addr += n; 957 + pavail[i].reg_size -= n; 958 + to_trim -= n; 959 + } 960 + if (to_trim) { 961 + n = end - trim_high; 962 + if (n > to_trim) 963 + n = to_trim; 964 + if (n) { 965 + pavail[i].reg_size -= n; 966 + to_trim -= n; 967 + } 968 + } 969 + } 970 + 971 + if (!to_trim) 972 + break; 973 + } 974 + 975 + /* Recalculate. */ 976 + *cur_size_p = 0UL; 977 + for (i = 0; i < pavail_ents; i++) { 978 + *end_of_phys_p = pavail[i].phys_addr + 979 + pavail[i].reg_size; 980 + *cur_size_p += pavail[i].reg_size; 981 + } 982 + } 983 + 875 984 static unsigned long __init bootmem_init(unsigned long *pages_avail, 876 985 unsigned long phys_base) 877 986 { ··· 998 889 end_of_phys_memory = pavail[i].phys_addr + 999 890 pavail[i].reg_size; 1000 891 bytes_avail += pavail[i].reg_size; 1001 - if (cmdline_memory_size) { 1002 - if (bytes_avail > cmdline_memory_size) { 1003 - unsigned long slack = bytes_avail - cmdline_memory_size; 1004 - 1005 - bytes_avail -= slack; 1006 - end_of_phys_memory -= slack; 1007 - 1008 - pavail[i].reg_size -= slack; 1009 - if ((long)pavail[i].reg_size <= 0L) { 1010 - pavail[i].phys_addr = 0xdeadbeefUL; 1011 - pavail[i].reg_size = 0UL; 1012 - pavail_ents = i; 1013 - } else { 1014 - pavail[i+1].reg_size = 0Ul; 1015 - pavail[i+1].phys_addr = 0xdeadbeefUL; 1016 - pavail_ents = i + 1; 1017 - } 1018 - break; 1019 - } 1020 - } 1021 892 } 1022 893 1023 - *pages_avail = bytes_avail >> PAGE_SHIFT; 1024 - 1025 - end_pfn = end_of_phys_memory >> PAGE_SHIFT; 894 + /* Determine the location of the initial ramdisk before trying 895 + * to honor the "mem=xxx" command line argument. We must know 896 + * where the kernel image and the ramdisk image are so that we 897 + * do not trim those two areas from the physical memory map. 898 + */ 1026 899 1027 900 #ifdef CONFIG_BLK_DEV_INITRD 1028 901 /* Now have to check initial ramdisk, so that bootmap does not overwrite it */ ··· 1023 932 } 1024 933 } 1025 934 #endif 935 + 936 + if (cmdline_memory_size && 937 + bytes_avail > cmdline_memory_size) 938 + trim_pavail(&bytes_avail, 939 + &end_of_phys_memory); 940 + 941 + *pages_avail = bytes_avail >> PAGE_SHIFT; 942 + 943 + end_pfn = end_of_phys_memory >> PAGE_SHIFT; 944 + 1026 945 /* Initialize the boot-time allocator. */ 1027 946 max_pfn = max_low_pfn = end_pfn; 1028 947 min_low_pfn = (phys_base >> PAGE_SHIFT);
+4 -2
drivers/input/serio/i8042-sparcio.h
··· 16 16 #define I8042_MUX_PHYS_DESC "sparcps2/serio%d" 17 17 18 18 static void __iomem *kbd_iobase; 19 + static struct resource *kbd_res; 19 20 20 21 #define I8042_COMMAND_REG (kbd_iobase + 0x64UL) 21 22 #define I8042_DATA_REG (kbd_iobase + 0x60UL) ··· 61 60 i8042_kbd_irq = irq; 62 61 kbd_iobase = of_ioremap(&kbd->resource[0], 63 62 0, 8, "kbd"); 63 + kbd_res = &kbd->resource[0]; 64 64 } else if (!strcmp(dp->name, OBP_PS2MS_NAME1) || 65 65 !strcmp(dp->name, OBP_PS2MS_NAME2)) { 66 66 struct of_device *ms = of_find_device_by_node(dp); ··· 79 77 80 78 static int __devexit sparc_i8042_remove(struct of_device *op) 81 79 { 82 - of_iounmap(kbd_iobase, 8); 80 + of_iounmap(kbd_res, kbd_iobase, 8); 83 81 84 82 return 0; 85 83 } ··· 121 119 if (i8042_kbd_irq == -1 || 122 120 i8042_aux_irq == -1) { 123 121 if (kbd_iobase) { 124 - of_iounmap(kbd_iobase, 8); 122 + of_iounmap(kbd_res, kbd_iobase, 8); 125 123 kbd_iobase = (void __iomem *) NULL; 126 124 } 127 125 return -ENODEV;
+8 -3
drivers/serial/sunsab.c
··· 1037 1037 err = request_irq(up->port.irq, sunsab_interrupt, 1038 1038 IRQF_SHARED, "sab", up); 1039 1039 if (err) { 1040 - of_iounmap(up->port.membase, 1040 + of_iounmap(&op->resource[0], 1041 + up->port.membase, 1041 1042 sizeof(union sab82532_async_regs)); 1042 1043 return err; 1043 1044 } ··· 1065 1064 sizeof(union sab82532_async_regs), 1066 1065 (inst * 2) + 1); 1067 1066 if (err) { 1068 - of_iounmap(up[0].port.membase, 1067 + of_iounmap(&op->resource[0], 1068 + up[0].port.membase, 1069 1069 sizeof(union sab82532_async_regs)); 1070 1070 free_irq(up[0].port.irq, &up[0]); 1071 1071 return err; ··· 1084 1082 1085 1083 static void __devexit sab_remove_one(struct uart_sunsab_port *up) 1086 1084 { 1085 + struct of_device *op = to_of_device(up->port.dev); 1086 + 1087 1087 uart_remove_one_port(&sunsab_reg, &up->port); 1088 1088 if (!(up->port.line & 1)) 1089 1089 free_irq(up->port.irq, up); 1090 - of_iounmap(up->port.membase, 1090 + of_iounmap(&op->resource[0], 1091 + up->port.membase, 1091 1092 sizeof(union sab82532_async_regs)); 1092 1093 } 1093 1094
+5 -5
drivers/serial/sunsu.c
··· 1480 1480 return 0; 1481 1481 1482 1482 out_unmap: 1483 - of_iounmap(up->port.membase, up->reg_size); 1483 + of_iounmap(&op->resource[0], up->port.membase, up->reg_size); 1484 1484 return err; 1485 1485 } 1486 1486 1487 - static int __devexit su_remove(struct of_device *dev) 1487 + static int __devexit su_remove(struct of_device *op) 1488 1488 { 1489 - struct uart_sunsu_port *up = dev_get_drvdata(&dev->dev);; 1489 + struct uart_sunsu_port *up = dev_get_drvdata(&op->dev); 1490 1490 1491 1491 if (up->su_type == SU_PORT_MS || 1492 1492 up->su_type == SU_PORT_KBD) { ··· 1499 1499 } 1500 1500 1501 1501 if (up->port.membase) 1502 - of_iounmap(up->port.membase, up->reg_size); 1502 + of_iounmap(&op->resource[0], up->port.membase, up->reg_size); 1503 1503 1504 - dev_set_drvdata(&dev->dev, NULL); 1504 + dev_set_drvdata(&op->dev, NULL); 1505 1505 1506 1506 return 0; 1507 1507 }
+8 -6
drivers/serial/sunzilog.c
··· 1379 1379 if (!keyboard_mouse) { 1380 1380 err = uart_add_one_port(&sunzilog_reg, &up[0].port); 1381 1381 if (err) { 1382 - of_iounmap(rp, sizeof(struct zilog_layout)); 1382 + of_iounmap(&op->resource[0], 1383 + rp, sizeof(struct zilog_layout)); 1383 1384 return err; 1384 1385 } 1385 1386 err = uart_add_one_port(&sunzilog_reg, &up[1].port); 1386 1387 if (err) { 1387 1388 uart_remove_one_port(&sunzilog_reg, &up[0].port); 1388 - of_iounmap(rp, sizeof(struct zilog_layout)); 1389 + of_iounmap(&op->resource[0], 1390 + rp, sizeof(struct zilog_layout)); 1389 1391 return err; 1390 1392 } 1391 1393 } else { ··· 1416 1414 uart_remove_one_port(&sunzilog_reg, &up->port); 1417 1415 } 1418 1416 1419 - static int __devexit zs_remove(struct of_device *dev) 1417 + static int __devexit zs_remove(struct of_device *op) 1420 1418 { 1421 - struct uart_sunzilog_port *up = dev_get_drvdata(&dev->dev); 1419 + struct uart_sunzilog_port *up = dev_get_drvdata(&op->dev); 1422 1420 struct zilog_layout __iomem *regs; 1423 1421 1424 1422 zs_remove_one(&up[0]); 1425 1423 zs_remove_one(&up[1]); 1426 1424 1427 1425 regs = sunzilog_chip_regs[up[0].port.line / 2]; 1428 - of_iounmap(regs, sizeof(struct zilog_layout)); 1426 + of_iounmap(&op->resource[0], regs, sizeof(struct zilog_layout)); 1429 1427 1430 - dev_set_drvdata(&dev->dev, NULL); 1428 + dev_set_drvdata(&op->dev, NULL); 1431 1429 1432 1430 return 0; 1433 1431 }
+10 -8
drivers/video/bw2.c
··· 320 320 all->info.fbops = &bw2_ops; 321 321 322 322 all->info.screen_base = 323 - sbus_ioremap(&op->resource[0], 0, all->par.fbsize, "bw2 ram"); 323 + of_ioremap(&op->resource[0], 0, all->par.fbsize, "bw2 ram"); 324 324 all->info.par = &all->par; 325 325 326 326 bw2_blank(0, &all->info); ··· 329 329 330 330 err= register_framebuffer(&all->info); 331 331 if (err < 0) { 332 - of_iounmap(all->par.regs, sizeof(struct bw2_regs)); 333 - of_iounmap(all->info.screen_base, all->par.fbsize); 332 + of_iounmap(&op->resource[0], 333 + all->par.regs, sizeof(struct bw2_regs)); 334 + of_iounmap(&op->resource[0], 335 + all->info.screen_base, all->par.fbsize); 334 336 kfree(all); 335 337 return err; 336 338 } ··· 353 351 return bw2_init_one(op); 354 352 } 355 353 356 - static int __devexit bw2_remove(struct of_device *dev) 354 + static int __devexit bw2_remove(struct of_device *op) 357 355 { 358 - struct all_info *all = dev_get_drvdata(&dev->dev); 356 + struct all_info *all = dev_get_drvdata(&op->dev); 359 357 360 358 unregister_framebuffer(&all->info); 361 359 362 - of_iounmap(all->par.regs, sizeof(struct bw2_regs)); 363 - of_iounmap(all->info.screen_base, all->par.fbsize); 360 + of_iounmap(&op->resource[0], all->par.regs, sizeof(struct bw2_regs)); 361 + of_iounmap(&op->resource[0], all->info.screen_base, all->par.fbsize); 364 362 365 363 kfree(all); 366 364 367 - dev_set_drvdata(&dev->dev, NULL); 365 + dev_set_drvdata(&op->dev, NULL); 368 366 369 367 return 0; 370 368 }
+16 -12
drivers/video/cg14.c
··· 452 452 struct cg14_par par; 453 453 }; 454 454 455 - static void cg14_unmap_regs(struct all_info *all) 455 + static void cg14_unmap_regs(struct of_device *op, struct all_info *all) 456 456 { 457 457 if (all->par.regs) 458 - of_iounmap(all->par.regs, sizeof(struct cg14_regs)); 458 + of_iounmap(&op->resource[0], 459 + all->par.regs, sizeof(struct cg14_regs)); 459 460 if (all->par.clut) 460 - of_iounmap(all->par.clut, sizeof(struct cg14_clut)); 461 + of_iounmap(&op->resource[0], 462 + all->par.clut, sizeof(struct cg14_clut)); 461 463 if (all->par.cursor) 462 - of_iounmap(all->par.cursor, sizeof(struct cg14_cursor)); 464 + of_iounmap(&op->resource[0], 465 + all->par.cursor, sizeof(struct cg14_cursor)); 463 466 if (all->info.screen_base) 464 - of_iounmap(all->info.screen_base, all->par.fbsize); 467 + of_iounmap(&op->resource[1], 468 + all->info.screen_base, all->par.fbsize); 465 469 } 466 470 467 471 static int __devinit cg14_init_one(struct of_device *op) ··· 510 506 511 507 if (!all->par.regs || !all->par.clut || !all->par.cursor || 512 508 !all->info.screen_base) 513 - cg14_unmap_regs(all); 509 + cg14_unmap_regs(op, all); 514 510 515 511 is_8mb = (((op->resource[1].end - op->resource[1].start) + 1) == 516 512 (8 * 1024 * 1024)); ··· 545 541 __cg14_reset(&all->par); 546 542 547 543 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 548 - cg14_unmap_regs(all); 544 + cg14_unmap_regs(op, all); 549 545 kfree(all); 550 546 return -ENOMEM; 551 547 } ··· 556 552 err = register_framebuffer(&all->info); 557 553 if (err < 0) { 558 554 fb_dealloc_cmap(&all->info.cmap); 559 - cg14_unmap_regs(all); 555 + cg14_unmap_regs(op, all); 560 556 kfree(all); 561 557 return err; 562 558 } ··· 578 574 return cg14_init_one(op); 579 575 } 580 576 581 - static int __devexit cg14_remove(struct of_device *dev) 577 + static int __devexit cg14_remove(struct of_device *op) 582 578 { 583 - struct all_info *all = dev_get_drvdata(&dev->dev); 579 + struct all_info *all = dev_get_drvdata(&op->dev); 584 580 585 581 unregister_framebuffer(&all->info); 586 582 fb_dealloc_cmap(&all->info.cmap); 587 583 588 - cg14_unmap_regs(all); 584 + cg14_unmap_regs(op, all); 589 585 590 586 kfree(all); 591 587 592 - dev_set_drvdata(&dev->dev, NULL); 588 + dev_set_drvdata(&op->dev, NULL); 593 589 594 590 return 0; 595 591 }
+13 -9
drivers/video/cg3.c
··· 403 403 cg3_do_default_mode(&all->par); 404 404 405 405 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 406 - of_iounmap(all->par.regs, sizeof(struct cg3_regs)); 407 - of_iounmap(all->info.screen_base, all->par.fbsize); 406 + of_iounmap(&op->resource[0], 407 + all->par.regs, sizeof(struct cg3_regs)); 408 + of_iounmap(&op->resource[0], 409 + all->info.screen_base, all->par.fbsize); 408 410 kfree(all); 409 411 return -ENOMEM; 410 412 } ··· 417 415 err = register_framebuffer(&all->info); 418 416 if (err < 0) { 419 417 fb_dealloc_cmap(&all->info.cmap); 420 - of_iounmap(all->par.regs, sizeof(struct cg3_regs)); 421 - of_iounmap(all->info.screen_base, all->par.fbsize); 418 + of_iounmap(&op->resource[0], 419 + all->par.regs, sizeof(struct cg3_regs)); 420 + of_iounmap(&op->resource[0], 421 + all->info.screen_base, all->par.fbsize); 422 422 kfree(all); 423 423 return err; 424 424 } ··· 440 436 return cg3_init_one(op); 441 437 } 442 438 443 - static int __devexit cg3_remove(struct of_device *dev) 439 + static int __devexit cg3_remove(struct of_device *op) 444 440 { 445 - struct all_info *all = dev_get_drvdata(&dev->dev); 441 + struct all_info *all = dev_get_drvdata(&op->dev); 446 442 447 443 unregister_framebuffer(&all->info); 448 444 fb_dealloc_cmap(&all->info.cmap); 449 445 450 - of_iounmap(all->par.regs, sizeof(struct cg3_regs)); 451 - of_iounmap(all->info.screen_base, all->par.fbsize); 446 + of_iounmap(&op->resource[0], all->par.regs, sizeof(struct cg3_regs)); 447 + of_iounmap(&op->resource[0], all->info.screen_base, all->par.fbsize); 452 448 453 449 kfree(all); 454 450 455 - dev_set_drvdata(&dev->dev, NULL); 451 + dev_set_drvdata(&op->dev, NULL); 456 452 457 453 return 0; 458 454 }
+19 -14
drivers/video/cg6.c
··· 658 658 struct cg6_par par; 659 659 }; 660 660 661 - static void cg6_unmap_regs(struct all_info *all) 661 + static void cg6_unmap_regs(struct of_device *op, struct all_info *all) 662 662 { 663 663 if (all->par.fbc) 664 - of_iounmap(all->par.fbc, 4096); 664 + of_iounmap(&op->resource[0], all->par.fbc, 4096); 665 665 if (all->par.tec) 666 - of_iounmap(all->par.tec, sizeof(struct cg6_tec)); 666 + of_iounmap(&op->resource[0], 667 + all->par.tec, sizeof(struct cg6_tec)); 667 668 if (all->par.thc) 668 - of_iounmap(all->par.thc, sizeof(struct cg6_thc)); 669 + of_iounmap(&op->resource[0], 670 + all->par.thc, sizeof(struct cg6_thc)); 669 671 if (all->par.bt) 670 - of_iounmap(all->par.bt, sizeof(struct bt_regs)); 672 + of_iounmap(&op->resource[0], 673 + all->par.bt, sizeof(struct bt_regs)); 671 674 if (all->par.fhc) 672 - of_iounmap(all->par.fhc, sizeof(u32)); 675 + of_iounmap(&op->resource[0], 676 + all->par.fhc, sizeof(u32)); 673 677 674 678 if (all->info.screen_base) 675 - of_iounmap(all->info.screen_base, all->par.fbsize); 679 + of_iounmap(&op->resource[0], 680 + all->info.screen_base, all->par.fbsize); 676 681 } 677 682 678 683 static int __devinit cg6_init_one(struct of_device *op) ··· 725 720 all->par.fbsize, "cgsix ram"); 726 721 if (!all->par.fbc || !all->par.tec || !all->par.thc || 727 722 !all->par.bt || !all->par.fhc || !all->info.screen_base) { 728 - cg6_unmap_regs(all); 723 + cg6_unmap_regs(op, all); 729 724 kfree(all); 730 725 return -ENOMEM; 731 726 } ··· 739 734 cg6_blank(0, &all->info); 740 735 741 736 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 742 - cg6_unmap_regs(all); 737 + cg6_unmap_regs(op, all); 743 738 kfree(all); 744 739 return -ENOMEM; 745 740 } ··· 749 744 750 745 err = register_framebuffer(&all->info); 751 746 if (err < 0) { 752 - cg6_unmap_regs(all); 747 + cg6_unmap_regs(op, all); 753 748 fb_dealloc_cmap(&all->info.cmap); 754 749 kfree(all); 755 750 return err; ··· 772 767 return cg6_init_one(op); 773 768 } 774 769 775 - static int __devexit cg6_remove(struct of_device *dev) 770 + static int __devexit cg6_remove(struct of_device *op) 776 771 { 777 - struct all_info *all = dev_get_drvdata(&dev->dev); 772 + struct all_info *all = dev_get_drvdata(&op->dev); 778 773 779 774 unregister_framebuffer(&all->info); 780 775 fb_dealloc_cmap(&all->info.cmap); 781 776 782 - cg6_unmap_regs(all); 777 + cg6_unmap_regs(op, all); 783 778 784 779 kfree(all); 785 780 786 - dev_set_drvdata(&dev->dev, NULL); 781 + dev_set_drvdata(&op->dev, NULL); 787 782 788 783 return 0; 789 784 }
+15 -10
drivers/video/ffb.c
··· 910 910 all->par.dac = of_ioremap(&op->resource[1], 0, 911 911 sizeof(struct ffb_dac), "ffb dac"); 912 912 if (!all->par.dac) { 913 - of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); 913 + of_iounmap(&op->resource[2], 914 + all->par.fbc, sizeof(struct ffb_fbc)); 914 915 kfree(all); 915 916 return -ENOMEM; 916 917 } ··· 969 968 970 969 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 971 970 printk(KERN_ERR "ffb: Could not allocate color map.\n"); 972 - of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); 973 - of_iounmap(all->par.dac, sizeof(struct ffb_dac)); 971 + of_iounmap(&op->resource[2], 972 + all->par.fbc, sizeof(struct ffb_fbc)); 973 + of_iounmap(&op->resource[1], 974 + all->par.dac, sizeof(struct ffb_dac)); 974 975 kfree(all); 975 976 return -ENOMEM; 976 977 } ··· 983 980 if (err < 0) { 984 981 printk(KERN_ERR "ffb: Could not register framebuffer.\n"); 985 982 fb_dealloc_cmap(&all->info.cmap); 986 - of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); 987 - of_iounmap(all->par.dac, sizeof(struct ffb_dac)); 983 + of_iounmap(&op->resource[2], 984 + all->par.fbc, sizeof(struct ffb_fbc)); 985 + of_iounmap(&op->resource[1], 986 + all->par.dac, sizeof(struct ffb_dac)); 988 987 kfree(all); 989 988 return err; 990 989 } ··· 1008 1003 return ffb_init_one(op); 1009 1004 } 1010 1005 1011 - static int __devexit ffb_remove(struct of_device *dev) 1006 + static int __devexit ffb_remove(struct of_device *op) 1012 1007 { 1013 - struct all_info *all = dev_get_drvdata(&dev->dev); 1008 + struct all_info *all = dev_get_drvdata(&op->dev); 1014 1009 1015 1010 unregister_framebuffer(&all->info); 1016 1011 fb_dealloc_cmap(&all->info.cmap); 1017 1012 1018 - of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); 1019 - of_iounmap(all->par.dac, sizeof(struct ffb_dac)); 1013 + of_iounmap(&op->resource[2], all->par.fbc, sizeof(struct ffb_fbc)); 1014 + of_iounmap(&op->resource[1], all->par.dac, sizeof(struct ffb_dac)); 1020 1015 1021 1016 kfree(all); 1022 1017 1023 - dev_set_drvdata(&dev->dev, NULL); 1018 + dev_set_drvdata(&op->dev, NULL); 1024 1019 1025 1020 return 0; 1026 1021 }
+15 -14
drivers/video/leo.c
··· 530 530 struct leo_par par; 531 531 }; 532 532 533 - static void leo_unmap_regs(struct all_info *all) 533 + static void leo_unmap_regs(struct of_device *op, struct all_info *all) 534 534 { 535 535 if (all->par.lc_ss0_usr) 536 - of_iounmap(all->par.lc_ss0_usr, 0x1000); 536 + of_iounmap(&op->resource[0], all->par.lc_ss0_usr, 0x1000); 537 537 if (all->par.ld_ss0) 538 - of_iounmap(all->par.ld_ss0, 0x1000); 538 + of_iounmap(&op->resource[0], all->par.ld_ss0, 0x1000); 539 539 if (all->par.ld_ss1) 540 - of_iounmap(all->par.ld_ss1, 0x1000); 540 + of_iounmap(&op->resource[0], all->par.ld_ss1, 0x1000); 541 541 if (all->par.lx_krn) 542 - of_iounmap(all->par.lx_krn, 0x1000); 542 + of_iounmap(&op->resource[0], all->par.lx_krn, 0x1000); 543 543 if (all->par.cursor) 544 - of_iounmap(all->par.cursor, sizeof(struct leo_cursor)); 544 + of_iounmap(&op->resource[0], 545 + all->par.cursor, sizeof(struct leo_cursor)); 545 546 if (all->info.screen_base) 546 - of_iounmap(all->info.screen_base, 0x800000); 547 + of_iounmap(&op->resource[0], all->info.screen_base, 0x800000); 547 548 } 548 549 549 550 static int __devinit leo_init_one(struct of_device *op) ··· 593 592 !all->par.lx_krn || 594 593 !all->par.cursor || 595 594 !all->info.screen_base) { 596 - leo_unmap_regs(all); 595 + leo_unmap_regs(op, all); 597 596 kfree(all); 598 597 return -ENOMEM; 599 598 } ··· 608 607 leo_blank(0, &all->info); 609 608 610 609 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 611 - leo_unmap_regs(all); 610 + leo_unmap_regs(op, all); 612 611 kfree(all); 613 612 return -ENOMEM;; 614 613 } ··· 618 617 err = register_framebuffer(&all->info); 619 618 if (err < 0) { 620 619 fb_dealloc_cmap(&all->info.cmap); 621 - leo_unmap_regs(all); 620 + leo_unmap_regs(op, all); 622 621 kfree(all); 623 622 return err; 624 623 } ··· 639 638 return leo_init_one(op); 640 639 } 641 640 642 - static int __devexit leo_remove(struct of_device *dev) 641 + static int __devexit leo_remove(struct of_device *op) 643 642 { 644 - struct all_info *all = dev_get_drvdata(&dev->dev); 643 + struct all_info *all = dev_get_drvdata(&op->dev); 645 644 646 645 unregister_framebuffer(&all->info); 647 646 fb_dealloc_cmap(&all->info.cmap); 648 647 649 - leo_unmap_regs(all); 648 + leo_unmap_regs(op, all); 650 649 651 650 kfree(all); 652 651 653 - dev_set_drvdata(&dev->dev, NULL); 652 + dev_set_drvdata(&op->dev, NULL); 654 653 655 654 return 0; 656 655 }
+15 -10
drivers/video/p9100.c
··· 297 297 all->info.screen_base = of_ioremap(&op->resource[2], 0, 298 298 all->par.fbsize, "p9100 ram"); 299 299 if (!all->info.screen_base) { 300 - of_iounmap(all->par.regs, sizeof(struct p9100_regs)); 300 + of_iounmap(&op->resource[0], 301 + all->par.regs, sizeof(struct p9100_regs)); 301 302 kfree(all); 302 303 return -ENOMEM; 303 304 } ··· 307 306 p9100_blank(0, &all->info); 308 307 309 308 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 310 - of_iounmap(all->par.regs, sizeof(struct p9100_regs)); 311 - of_iounmap(all->info.screen_base, all->par.fbsize); 309 + of_iounmap(&op->resource[0], 310 + all->par.regs, sizeof(struct p9100_regs)); 311 + of_iounmap(&op->resource[2], 312 + all->info.screen_base, all->par.fbsize); 312 313 kfree(all); 313 314 return -ENOMEM; 314 315 } ··· 320 317 err = register_framebuffer(&all->info); 321 318 if (err < 0) { 322 319 fb_dealloc_cmap(&all->info.cmap); 323 - of_iounmap(all->par.regs, sizeof(struct p9100_regs)); 324 - of_iounmap(all->info.screen_base, all->par.fbsize); 320 + of_iounmap(&op->resource[0], 321 + all->par.regs, sizeof(struct p9100_regs)); 322 + of_iounmap(&op->resource[2], 323 + all->info.screen_base, all->par.fbsize); 325 324 kfree(all); 326 325 return err; 327 326 } ··· 345 340 return p9100_init_one(op); 346 341 } 347 342 348 - static int __devexit p9100_remove(struct of_device *dev) 343 + static int __devexit p9100_remove(struct of_device *op) 349 344 { 350 - struct all_info *all = dev_get_drvdata(&dev->dev); 345 + struct all_info *all = dev_get_drvdata(&op->dev); 351 346 352 347 unregister_framebuffer(&all->info); 353 348 fb_dealloc_cmap(&all->info.cmap); 354 349 355 - of_iounmap(all->par.regs, sizeof(struct p9100_regs)); 356 - of_iounmap(all->info.screen_base, all->par.fbsize); 350 + of_iounmap(&op->resource[0], all->par.regs, sizeof(struct p9100_regs)); 351 + of_iounmap(&op->resource[2], all->info.screen_base, all->par.fbsize); 357 352 358 353 kfree(all); 359 354 360 - dev_set_drvdata(&dev->dev, NULL); 355 + dev_set_drvdata(&op->dev, NULL); 361 356 362 357 return 0; 363 358 }
+19 -14
drivers/video/tcx.c
··· 350 350 struct tcx_par par; 351 351 }; 352 352 353 - static void tcx_unmap_regs(struct all_info *all) 353 + static void tcx_unmap_regs(struct of_device *op, struct all_info *all) 354 354 { 355 355 if (all->par.tec) 356 - of_iounmap(all->par.tec, sizeof(struct tcx_tec)); 356 + of_iounmap(&op->resource[7], 357 + all->par.tec, sizeof(struct tcx_tec)); 357 358 if (all->par.thc) 358 - of_iounmap(all->par.thc, sizeof(struct tcx_thc)); 359 + of_iounmap(&op->resource[9], 360 + all->par.thc, sizeof(struct tcx_thc)); 359 361 if (all->par.bt) 360 - of_iounmap(all->par.bt, sizeof(struct bt_regs)); 362 + of_iounmap(&op->resource[8], 363 + all->par.bt, sizeof(struct bt_regs)); 361 364 if (all->par.cplane) 362 - of_iounmap(all->par.cplane, all->par.fbsize * sizeof(u32)); 365 + of_iounmap(&op->resource[4], 366 + all->par.cplane, all->par.fbsize * sizeof(u32)); 363 367 if (all->info.screen_base) 364 - of_iounmap(all->info.screen_base, all->par.fbsize); 368 + of_iounmap(&op->resource[0], 369 + all->info.screen_base, all->par.fbsize); 365 370 } 366 371 367 372 static int __devinit tcx_init_one(struct of_device *op) ··· 403 398 all->par.fbsize, "tcx ram"); 404 399 if (!all->par.tec || !all->par.thc || 405 400 !all->par.bt || !all->info.screen_base) { 406 - tcx_unmap_regs(all); 401 + tcx_unmap_regs(op, all); 407 402 kfree(all); 408 403 return -ENOMEM; 409 404 } ··· 414 409 all->par.fbsize * sizeof(u32), 415 410 "tcx cplane"); 416 411 if (!all->par.cplane) { 417 - tcx_unmap_regs(all); 412 + tcx_unmap_regs(op, all); 418 413 kfree(all); 419 414 return -ENOMEM; 420 415 } ··· 466 461 tcx_blank(FB_BLANK_UNBLANK, &all->info); 467 462 468 463 if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { 469 - tcx_unmap_regs(all); 464 + tcx_unmap_regs(op, all); 470 465 kfree(all); 471 466 return -ENOMEM; 472 467 } ··· 477 472 err = register_framebuffer(&all->info); 478 473 if (err < 0) { 479 474 fb_dealloc_cmap(&all->info.cmap); 480 - tcx_unmap_regs(all); 475 + tcx_unmap_regs(op, all); 481 476 kfree(all); 482 477 return err; 483 478 } ··· 500 495 return tcx_init_one(op); 501 496 } 502 497 503 - static int __devexit tcx_remove(struct of_device *dev) 498 + static int __devexit tcx_remove(struct of_device *op) 504 499 { 505 - struct all_info *all = dev_get_drvdata(&dev->dev); 500 + struct all_info *all = dev_get_drvdata(&op->dev); 506 501 507 502 unregister_framebuffer(&all->info); 508 503 fb_dealloc_cmap(&all->info.cmap); 509 504 510 - tcx_unmap_regs(all); 505 + tcx_unmap_regs(op, all); 511 506 512 507 kfree(all); 513 508 514 - dev_set_drvdata(&dev->dev, NULL); 509 + dev_set_drvdata(&op->dev, NULL); 515 510 516 511 return 0; 517 512 }
+1 -1
include/asm-sparc/of_device.h
··· 33 33 #define to_of_device(d) container_of(d, struct of_device, dev) 34 34 35 35 extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 36 - extern void of_iounmap(void __iomem *base, unsigned long size); 36 + extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 37 37 38 38 extern struct of_device *of_find_device_by_node(struct device_node *); 39 39
+1 -1
include/asm-sparc64/of_device.h
··· 34 34 #define to_of_device(d) container_of(d, struct of_device, dev) 35 35 36 36 extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 37 - extern void of_iounmap(void __iomem *base, unsigned long size); 37 + extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 38 38 39 39 extern struct of_device *of_find_device_by_node(struct device_node *); 40 40