Lines Matching refs:op
244 static void __init build_device_resources(struct platform_device *op,
258 bus->count_cells(op->dev.of_node, &na, &ns);
260 preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg);
270 op->resource = op->archdata.resource;
271 op->num_resources = num_reg;
273 struct resource *r = &op->resource[index];
276 struct device_node *dp = op->dev.of_node;
326 op->dev.of_node->full_name, index,
334 r->name = op->dev.of_node->name;
341 struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
346 if (!op)
349 sd = &op->dev.archdata;
350 sd->op = op;
352 op->dev.of_node = dp;
356 op->archdata.num_irqs = len / sizeof(struct linux_prom_irqs);
357 for (i = 0; i < op->archdata.num_irqs; i++)
358 op->archdata.irqs[i] = intr[i].pri;
364 op->archdata.num_irqs = len / sizeof(unsigned int);
365 for (i = 0; i < op->archdata.num_irqs; i++)
366 op->archdata.irqs[i] = irq[i];
368 op->archdata.num_irqs = 0;
410 for (i = 0; i < op->archdata.num_irqs; i++) {
411 int this_irq = op->archdata.irqs[i];
419 op->archdata.irqs[i] = this_irq;
424 build_device_resources(op, parent);
426 op->dev.parent = parent;
427 op->dev.bus = &platform_bus_type;
429 dev_set_name(&op->dev, "root");
431 dev_set_name(&op->dev, "%08x", dp->phandle);
433 if (of_device_register(op)) {
436 kfree(op);
437 op = NULL;
440 return op;
446 struct platform_device *op = scan_one_device(dp, parent);
448 if (op)
449 scan_tree(dp->child, &op->dev);