Lines Matching refs:np

186 static int macio_resource_quirks(struct device_node *np, struct resource *res,  in macio_resource_quirks()  argument
194 if (index == 0 && !strcmp(np->name, "gc")) in macio_resource_quirks()
198 if (index >= 2 && !strcmp(np->name, "radio")) in macio_resource_quirks()
211 if (!strcmp(np->name, "escc")) in macio_resource_quirks()
215 if (index >= 3 && !(strcmp(np->name, "ch-a") && in macio_resource_quirks()
216 strcmp(np->name, "ch-b"))) in macio_resource_quirks()
220 if (index > 0 && !strcmp(np->name, "media-bay")) in macio_resource_quirks()
224 if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") && in macio_resource_quirks()
225 strcmp(np->type, "ide") && strcmp(np->type, "ata"))) { in macio_resource_quirks()
251 struct device_node *np = dev->ofdev.dev.of_node; in macio_add_missing_resources() local
264 if (strcmp(np->name, "ch-a") == 0) { in macio_add_missing_resources()
272 if (strcmp(np->name, "media-bay") == 0) { in macio_add_missing_resources()
278 if (dev->media_bay != NULL && strcmp(np->name, "floppy") == 0) { in macio_add_missing_resources()
283 if (dev->media_bay != NULL && strcasecmp(np->name, "ata4") == 0) { in macio_add_missing_resources()
292 struct device_node *np = dev->ofdev.dev.of_node; in macio_setup_interrupts() local
302 irq = irq_of_parse_and_map(np, i++); in macio_setup_interrupts()
308 if (macio_resource_quirks(np, res, i - 1)) { in macio_setup_interrupts()
320 struct device_node *np = dev->ofdev.dev.of_node; in macio_setup_resources() local
324 for (index = 0; of_address_to_resource(np, index, &r) == 0; index++) { in macio_setup_resources()
332 if (macio_resource_quirks(np, res, index)) { in macio_setup_resources()
360 struct device_node *np, in macio_add_one_device() argument
367 if (np == NULL) in macio_add_one_device()
376 dev->ofdev.dev.of_node = np; in macio_add_one_device()
404 if (np == chip->of_node) { in macio_add_one_device()
412 MAX_NODE_NAME_SIZE, np->name); in macio_add_one_device()
414 reg = of_get_property(np, "reg", NULL); in macio_add_one_device()
417 reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name); in macio_add_one_device()
436 static int macio_skip_device(struct device_node *np) in macio_skip_device() argument
438 if (strncmp(np->name, "battery", 7) == 0) in macio_skip_device()
440 if (strncmp(np->name, "escc-legacy", 11) == 0) in macio_skip_device()
458 struct device_node *np, *pnode; in macio_pci_add_devices() local
481 for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { in macio_pci_add_devices()
482 if (macio_skip_device(np)) in macio_pci_add_devices()
484 of_node_get(np); in macio_pci_add_devices()
485 mdev = macio_add_one_device(chip, &rdev->ofdev.dev, np, NULL, in macio_pci_add_devices()
488 of_node_put(np); in macio_pci_add_devices()
489 else if (strncmp(np->name, "media-bay", 9) == 0) in macio_pci_add_devices()
491 else if (strncmp(np->name, "escc", 4) == 0) in macio_pci_add_devices()
498 for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { in macio_pci_add_devices()
499 if (macio_skip_device(np)) in macio_pci_add_devices()
501 of_node_get(np); in macio_pci_add_devices()
502 if (macio_add_one_device(chip, &mbdev->ofdev.dev, np, in macio_pci_add_devices()
504 of_node_put(np); in macio_pci_add_devices()
511 for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { in macio_pci_add_devices()
512 if (macio_skip_device(np)) in macio_pci_add_devices()
514 of_node_get(np); in macio_pci_add_devices()
515 if (macio_add_one_device(chip, &sdev->ofdev.dev, np, in macio_pci_add_devices()
517 of_node_put(np); in macio_pci_add_devices()
686 struct device_node* np; in macio_pci_probe() local
695 np = pci_device_to_OF_node(pdev); in macio_pci_probe()
696 if (np == NULL) in macio_pci_probe()
702 of_node_get(np); in macio_pci_probe()
707 chip = macio_find(np, macio_unknown); in macio_pci_probe()
708 of_node_put(np); in macio_pci_probe()