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 branch 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6

* 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6:
drivercore: revert addition of of_match to struct device
of: fix race when matching drivers

+108 -46
+5 -2
arch/powerpc/platforms/83xx/suspend.c
··· 318 318 .end = mpc83xx_suspend_end, 319 319 }; 320 320 321 + static struct of_device_id pmc_match[]; 321 322 static int pmc_probe(struct platform_device *ofdev) 322 323 { 324 + const struct of_device_id *match; 323 325 struct device_node *np = ofdev->dev.of_node; 324 326 struct resource res; 325 327 struct pmc_type *type; 326 328 int ret = 0; 327 329 328 - if (!ofdev->dev.of_match) 330 + match = of_match_device(pmc_match, &ofdev->dev); 331 + if (!match) 329 332 return -EINVAL; 330 333 331 - type = ofdev->dev.of_match->data; 334 + type = match->data; 332 335 333 336 if (!of_device_is_available(np)) 334 337 return -ENODEV;
+5 -2
arch/powerpc/sysdev/fsl_msi.c
··· 304 304 return 0; 305 305 } 306 306 307 + static const struct of_device_id fsl_of_msi_ids[]; 307 308 static int __devinit fsl_of_msi_probe(struct platform_device *dev) 308 309 { 310 + const struct of_device_id *match; 309 311 struct fsl_msi *msi; 310 312 struct resource res; 311 313 int err, i, j, irq_index, count; ··· 318 316 u32 offset; 319 317 static const u32 all_avail[] = { 0, NR_MSI_IRQS }; 320 318 321 - if (!dev->dev.of_match) 319 + match = of_match_device(fsl_of_msi_ids, &dev->dev); 320 + if (!match) 322 321 return -EINVAL; 323 - features = dev->dev.of_match->data; 322 + features = match->data; 324 323 325 324 printk(KERN_DEBUG "Setting up Freescale MSI support\n"); 326 325
+4 -1
arch/sparc/kernel/pci_sabre.c
··· 452 452 sabre_scan_bus(pbm, &op->dev); 453 453 } 454 454 455 + static const struct of_device_id sabre_match[]; 455 456 static int __devinit sabre_probe(struct platform_device *op) 456 457 { 458 + const struct of_device_id *match; 457 459 const struct linux_prom64_registers *pr_regs; 458 460 struct device_node *dp = op->dev.of_node; 459 461 struct pci_pbm_info *pbm; ··· 465 463 const u32 *vdma; 466 464 u64 clear_irq; 467 465 468 - hummingbird_p = op->dev.of_match && (op->dev.of_match->data != NULL); 466 + match = of_match_device(sabre_match, &op->dev); 467 + hummingbird_p = match && (match->data != NULL); 469 468 if (!hummingbird_p) { 470 469 struct device_node *cpu_dp; 471 470
+6 -2
arch/sparc/kernel/pci_schizo.c
··· 1458 1458 return err; 1459 1459 } 1460 1460 1461 + static const struct of_device_id schizo_match[]; 1461 1462 static int __devinit schizo_probe(struct platform_device *op) 1462 1463 { 1463 - if (!op->dev.of_match) 1464 + const struct of_device_id *match; 1465 + 1466 + match = of_match_device(schizo_match, &op->dev); 1467 + if (!match) 1464 1468 return -EINVAL; 1465 - return __schizo_init(op, (unsigned long) op->dev.of_match->data); 1469 + return __schizo_init(op, (unsigned long)match->data); 1466 1470 } 1467 1471 1468 1472 /* The ordering of this table is very important. Some Tomatillo
+5 -2
drivers/atm/fore200e.c
··· 2643 2643 } 2644 2644 2645 2645 #ifdef CONFIG_SBUS 2646 + static const struct of_device_id fore200e_sba_match[]; 2646 2647 static int __devinit fore200e_sba_probe(struct platform_device *op) 2647 2648 { 2649 + const struct of_device_id *match; 2648 2650 const struct fore200e_bus *bus; 2649 2651 struct fore200e *fore200e; 2650 2652 static int index = 0; 2651 2653 int err; 2652 2654 2653 - if (!op->dev.of_match) 2655 + match = of_match_device(fore200e_sba_match, &op->dev); 2656 + if (!match) 2654 2657 return -EINVAL; 2655 - bus = op->dev.of_match->data; 2658 + bus = match->data; 2656 2659 2657 2660 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); 2658 2661 if (!fore200e)
+5 -2
drivers/char/hw_random/n2-drv.c
··· 619 619 pr_info("%s", version); 620 620 } 621 621 622 + static const struct of_device_id n2rng_match[]; 622 623 static int __devinit n2rng_probe(struct platform_device *op) 623 624 { 625 + const struct of_device_id *match; 624 626 int victoria_falls; 625 627 int err = -ENOMEM; 626 628 struct n2rng *np; 627 629 628 - if (!op->dev.of_match) 630 + match = of_match_device(n2rng_match, &op->dev); 631 + if (!match) 629 632 return -EINVAL; 630 - victoria_falls = (op->dev.of_match->data != NULL); 633 + victoria_falls = (match->data != NULL); 631 634 632 635 n2rng_driver_version(); 633 636 np = kzalloc(sizeof(*np), GFP_KERNEL);
+5 -2
drivers/char/ipmi/ipmi_si_intf.c
··· 2554 2554 }; 2555 2555 #endif /* CONFIG_PCI */ 2556 2556 2557 + static struct of_device_id ipmi_match[]; 2557 2558 static int __devinit ipmi_probe(struct platform_device *dev) 2558 2559 { 2559 2560 #ifdef CONFIG_OF 2561 + const struct of_device_id *match; 2560 2562 struct smi_info *info; 2561 2563 struct resource resource; 2562 2564 const __be32 *regsize, *regspacing, *regshift; ··· 2568 2566 2569 2567 dev_info(&dev->dev, "probing via device tree\n"); 2570 2568 2571 - if (!dev->dev.of_match) 2569 + match = of_match_device(ipmi_match, &dev->dev); 2570 + if (!match) 2572 2571 return -EINVAL; 2573 2572 2574 2573 ret = of_address_to_resource(np, 0, &resource); ··· 2604 2601 return -ENOMEM; 2605 2602 } 2606 2603 2607 - info->si_type = (enum si_type) dev->dev.of_match->data; 2604 + info->si_type = (enum si_type) match->data; 2608 2605 info->addr_source = SI_DEVICETREE; 2609 2606 info->irq_setup = std_irq_setup; 2610 2607
+9 -5
drivers/char/xilinx_hwicap/xilinx_hwicap.c
··· 715 715 } 716 716 717 717 #ifdef CONFIG_OF 718 - static int __devinit hwicap_of_probe(struct platform_device *op) 718 + static int __devinit hwicap_of_probe(struct platform_device *op, 719 + const struct hwicap_driver_config *config) 719 720 { 720 721 struct resource res; 721 722 const unsigned int *id; 722 723 const char *family; 723 724 int rc; 724 - const struct hwicap_driver_config *config = op->dev.of_match->data; 725 725 const struct config_registers *regs; 726 726 727 727 ··· 751 751 regs); 752 752 } 753 753 #else 754 - static inline int hwicap_of_probe(struct platform_device *op) 754 + static inline int hwicap_of_probe(struct platform_device *op, 755 + const struct hwicap_driver_config *config) 755 756 { 756 757 return -EINVAL; 757 758 } 758 759 #endif /* CONFIG_OF */ 759 760 761 + static const struct of_device_id __devinitconst hwicap_of_match[]; 760 762 static int __devinit hwicap_drv_probe(struct platform_device *pdev) 761 763 { 764 + const struct of_device_id *match; 762 765 struct resource *res; 763 766 const struct config_registers *regs; 764 767 const char *family; 765 768 766 - if (pdev->dev.of_match) 767 - return hwicap_of_probe(pdev); 769 + match = of_match_device(hwicap_of_match, &pdev->dev); 770 + if (match) 771 + return hwicap_of_probe(pdev, match->data); 768 772 769 773 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 770 774 if (!res)
+1 -1
drivers/edac/ppc4xx_edac.c
··· 1019 1019 struct ppc4xx_edac_pdata *pdata = NULL; 1020 1020 const struct device_node *np = op->dev.of_node; 1021 1021 1022 - if (op->dev.of_match == NULL) 1022 + if (of_match_device(ppc4xx_edac_match, &op->dev) == NULL) 1023 1023 return -EINVAL; 1024 1024 1025 1025 /* Initial driver pointers and private data */
+6 -3
drivers/i2c/busses/i2c-mpc.c
··· 560 560 .timeout = HZ, 561 561 }; 562 562 563 + static const struct of_device_id mpc_i2c_of_match[]; 563 564 static int __devinit fsl_i2c_probe(struct platform_device *op) 564 565 { 566 + const struct of_device_id *match; 565 567 struct mpc_i2c *i2c; 566 568 const u32 *prop; 567 569 u32 clock = MPC_I2C_CLOCK_LEGACY; 568 570 int result = 0; 569 571 int plen; 570 572 571 - if (!op->dev.of_match) 573 + match = of_match_device(mpc_i2c_of_match, &op->dev); 574 + if (!match) 572 575 return -EINVAL; 573 576 574 577 i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); ··· 608 605 clock = *prop; 609 606 } 610 607 611 - if (op->dev.of_match->data) { 612 - struct mpc_i2c_data *data = op->dev.of_match->data; 608 + if (match->data) { 609 + struct mpc_i2c_data *data = match->data; 613 610 data->setup(op->dev.of_node, i2c, clock, data->prescaler); 614 611 } else { 615 612 /* Backwards compatibility */
+5 -2
drivers/mmc/host/sdhci-of-core.c
··· 124 124 #endif 125 125 } 126 126 127 + static const struct of_device_id sdhci_of_match[]; 127 128 static int __devinit sdhci_of_probe(struct platform_device *ofdev) 128 129 { 130 + const struct of_device_id *match; 129 131 struct device_node *np = ofdev->dev.of_node; 130 132 struct sdhci_of_data *sdhci_of_data; 131 133 struct sdhci_host *host; ··· 136 134 int size; 137 135 int ret; 138 136 139 - if (!ofdev->dev.of_match) 137 + match = of_match_device(sdhci_of_match, &ofdev->dev); 138 + if (!match) 140 139 return -EINVAL; 141 - sdhci_of_data = ofdev->dev.of_match->data; 140 + sdhci_of_data = match->data; 142 141 143 142 if (!of_device_is_available(np)) 144 143 return -ENODEV;
+5 -2
drivers/mtd/maps/physmap_of.c
··· 214 214 } 215 215 #endif 216 216 217 + static struct of_device_id of_flash_match[]; 217 218 static int __devinit of_flash_probe(struct platform_device *dev) 218 219 { 219 220 #ifdef CONFIG_MTD_PARTITIONS 220 221 const char **part_probe_types; 221 222 #endif 223 + const struct of_device_id *match; 222 224 struct device_node *dp = dev->dev.of_node; 223 225 struct resource res; 224 226 struct of_flash *info; ··· 234 232 struct mtd_info **mtd_list = NULL; 235 233 resource_size_t res_size; 236 234 237 - if (!dev->dev.of_match) 235 + match = of_match_device(of_flash_match, &dev->dev); 236 + if (!match) 238 237 return -EINVAL; 239 - probe_type = dev->dev.of_match->data; 238 + probe_type = match->data; 240 239 241 240 reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); 242 241
+5 -2
drivers/net/can/mscan/mpc5xxx_can.c
··· 247 247 } 248 248 #endif /* CONFIG_PPC_MPC512x */ 249 249 250 + static struct of_device_id mpc5xxx_can_table[]; 250 251 static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) 251 252 { 253 + const struct of_device_id *match; 252 254 struct mpc5xxx_can_data *data; 253 255 struct device_node *np = ofdev->dev.of_node; 254 256 struct net_device *dev; ··· 260 258 int irq, mscan_clksrc = 0; 261 259 int err = -ENOMEM; 262 260 263 - if (!ofdev->dev.of_match) 261 + match = of_match_device(mpc5xxx_can_table, &ofdev->dev); 262 + if (!match) 264 263 return -EINVAL; 265 - data = (struct mpc5xxx_can_data *)ofdev->dev.of_match->data; 264 + data = match->data; 266 265 267 266 base = of_iomap(np, 0); 268 267 if (!base) {
+6 -3
drivers/net/fs_enet/fs_enet-main.c
··· 998 998 #endif 999 999 }; 1000 1000 1001 + static struct of_device_id fs_enet_match[]; 1001 1002 static int __devinit fs_enet_probe(struct platform_device *ofdev) 1002 1003 { 1004 + const struct of_device_id *match; 1003 1005 struct net_device *ndev; 1004 1006 struct fs_enet_private *fep; 1005 1007 struct fs_platform_info *fpi; ··· 1009 1007 const u8 *mac_addr; 1010 1008 int privsize, len, ret = -ENODEV; 1011 1009 1012 - if (!ofdev->dev.of_match) 1010 + match = of_match_device(fs_enet_match, &ofdev->dev); 1011 + if (!match) 1013 1012 return -EINVAL; 1014 1013 1015 1014 fpi = kzalloc(sizeof(*fpi), GFP_KERNEL); 1016 1015 if (!fpi) 1017 1016 return -ENOMEM; 1018 1017 1019 - if (!IS_FEC(ofdev->dev.of_match)) { 1018 + if (!IS_FEC(match)) { 1020 1019 data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len); 1021 1020 if (!data || len != 4) 1022 1021 goto out_free_fpi; ··· 1052 1049 fep->dev = &ofdev->dev; 1053 1050 fep->ndev = ndev; 1054 1051 fep->fpi = fpi; 1055 - fep->ops = ofdev->dev.of_match->data; 1052 + fep->ops = match->data; 1056 1053 1057 1054 ret = fep->ops->setup_data(ndev); 1058 1055 if (ret)
+5 -2
drivers/net/fs_enet/mii-fec.c
··· 101 101 return 0; 102 102 } 103 103 104 + static struct of_device_id fs_enet_mdio_fec_match[]; 104 105 static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev) 105 106 { 107 + const struct of_device_id *match; 106 108 struct resource res; 107 109 struct mii_bus *new_bus; 108 110 struct fec_info *fec; 109 111 int (*get_bus_freq)(struct device_node *); 110 112 int ret = -ENOMEM, clock, speed; 111 113 112 - if (!ofdev->dev.of_match) 114 + match = of_match_device(fs_enet_mdio_fec_match, &ofdev->dev); 115 + if (!match) 113 116 return -EINVAL; 114 - get_bus_freq = ofdev->dev.of_match->data; 117 + get_bus_freq = match->data; 115 118 116 119 new_bus = mdiobus_alloc(); 117 120 if (!new_bus)
+5 -2
drivers/net/sunhme.c
··· 3237 3237 #endif 3238 3238 3239 3239 #ifdef CONFIG_SBUS 3240 + static const struct of_device_id hme_sbus_match[]; 3240 3241 static int __devinit hme_sbus_probe(struct platform_device *op) 3241 3242 { 3243 + const struct of_device_id *match; 3242 3244 struct device_node *dp = op->dev.of_node; 3243 3245 const char *model = of_get_property(dp, "model", NULL); 3244 3246 int is_qfe; 3245 3247 3246 - if (!op->dev.of_match) 3248 + match = of_match_device(hme_sbus_match, &op->dev); 3249 + if (!match) 3247 3250 return -EINVAL; 3248 - is_qfe = (op->dev.of_match->data != NULL); 3251 + is_qfe = (match->data != NULL); 3249 3252 3250 3253 if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe")) 3251 3254 is_qfe = 1;
+5 -2
drivers/scsi/qlogicpti.c
··· 1292 1292 .use_clustering = ENABLE_CLUSTERING, 1293 1293 }; 1294 1294 1295 + static const struct of_device_id qpti_match[]; 1295 1296 static int __devinit qpti_sbus_probe(struct platform_device *op) 1296 1297 { 1298 + const struct of_device_id *match; 1297 1299 struct scsi_host_template *tpnt; 1298 1300 struct device_node *dp = op->dev.of_node; 1299 1301 struct Scsi_Host *host; ··· 1303 1301 static int nqptis; 1304 1302 const char *fcode; 1305 1303 1306 - if (!op->dev.of_match) 1304 + match = of_match_device(qpti_match, &op->dev); 1305 + if (!match) 1307 1306 return -EINVAL; 1308 - tpnt = op->dev.of_match->data; 1307 + tpnt = match->data; 1309 1308 1310 1309 /* Sometimes Antares cards come up not completely 1311 1310 * setup, and we get a report of a zero IRQ.
+5 -2
drivers/tty/serial/of_serial.c
··· 80 80 /* 81 81 * Try to register a serial port 82 82 */ 83 + static struct of_device_id of_platform_serial_table[]; 83 84 static int __devinit of_platform_serial_probe(struct platform_device *ofdev) 84 85 { 86 + const struct of_device_id *match; 85 87 struct of_serial_info *info; 86 88 struct uart_port port; 87 89 int port_type; 88 90 int ret; 89 91 90 - if (!ofdev->dev.of_match) 92 + match = of_match_device(of_platform_serial_table, &ofdev->dev); 93 + if (!match) 91 94 return -EINVAL; 92 95 93 96 if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) ··· 100 97 if (info == NULL) 101 98 return -ENOMEM; 102 99 103 - port_type = (unsigned long)ofdev->dev.of_match->data; 100 + port_type = (unsigned long)match->data; 104 101 ret = of_platform_serial_setup(ofdev, port_type, &port); 105 102 if (ret) 106 103 goto out;
+5 -2
drivers/usb/gadget/fsl_qe_udc.c
··· 2539 2539 } 2540 2540 2541 2541 /* Driver probe functions */ 2542 + static const struct of_device_id qe_udc_match[]; 2542 2543 static int __devinit qe_udc_probe(struct platform_device *ofdev) 2543 2544 { 2545 + const struct of_device_id *match; 2544 2546 struct device_node *np = ofdev->dev.of_node; 2545 2547 struct qe_ep *ep; 2546 2548 unsigned int ret = 0; 2547 2549 unsigned int i; 2548 2550 const void *prop; 2549 2551 2550 - if (!ofdev->dev.of_match) 2552 + match = of_match_device(qe_udc_match, &ofdev->dev); 2553 + if (!match) 2551 2554 return -EINVAL; 2552 2555 2553 2556 prop = of_get_property(np, "mode", NULL); ··· 2564 2561 return -ENOMEM; 2565 2562 } 2566 2563 2567 - udc_controller->soc_type = (unsigned long)ofdev->dev.of_match->data; 2564 + udc_controller->soc_type = (unsigned long)match->data; 2568 2565 udc_controller->usb_regs = of_iomap(np, 0); 2569 2566 if (!udc_controller->usb_regs) { 2570 2567 ret = -ENOMEM;
+5 -2
drivers/watchdog/mpc8xxx_wdt.c
··· 185 185 .fops = &mpc8xxx_wdt_fops, 186 186 }; 187 187 188 + static const struct of_device_id mpc8xxx_wdt_match[]; 188 189 static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) 189 190 { 190 191 int ret; 192 + const struct of_device_id *match; 191 193 struct device_node *np = ofdev->dev.of_node; 192 194 struct mpc8xxx_wdt_type *wdt_type; 193 195 u32 freq = fsl_get_sys_freq(); 194 196 bool enabled; 195 197 196 - if (!ofdev->dev.of_match) 198 + match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev); 199 + if (!match) 197 200 return -EINVAL; 198 - wdt_type = ofdev->dev.of_match->data; 201 + wdt_type = match->data; 199 202 200 203 if (!freq || freq == -1) 201 204 return -EINVAL;
-1
include/linux/device.h
··· 442 442 struct dev_archdata archdata; 443 443 444 444 struct device_node *of_node; /* associated device tree node */ 445 - const struct of_device_id *of_match; /* matching of_device_id from driver */ 446 445 447 446 dev_t devt; /* dev_t, creates the sysfs "dev" */ 448 447
+6 -2
include/linux/of_device.h
··· 21 21 static inline int of_driver_match_device(struct device *dev, 22 22 const struct device_driver *drv) 23 23 { 24 - dev->of_match = of_match_device(drv->of_match_table, dev); 25 - return dev->of_match != NULL; 24 + return of_match_device(drv->of_match_table, dev) != NULL; 26 25 } 27 26 28 27 extern struct platform_device *of_dev_get(struct platform_device *dev); ··· 57 58 58 59 static inline void of_device_node_put(struct device *dev) { } 59 60 61 + static inline const struct of_device_id *of_match_device( 62 + const struct of_device_id *matches, const struct device *dev) 63 + { 64 + return NULL; 65 + } 60 66 #endif /* CONFIG_OF_DEVICE */ 61 67 62 68 #endif /* _LINUX_OF_DEVICE_H */