struct resource *res; /* IO mem resources */
int ret = 0;
struct irq_list *tmp;
- int count;
+ int count = 0;
struct mb_rproc_pdata *local;
/* Init list for IRQs - it can be long list */
INIT_LIST_HEAD(&local->mylist.list);
- count = of_irq_count(pdev->dev.of_node);
/* Alloc IRQ based on DTS to be sure that no other driver will use it */
- while (count--) {
+ do {
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, count++);
+ if (!res)
+ break;
+
tmp = kzalloc(sizeof(struct irq_list), GFP_KERNEL);
if (!tmp) {
dev_err(&pdev->dev, "Unable to alloc irq list\n");
goto irq_fault;
}
- tmp->irq = irq_of_parse_and_map(pdev->dev.of_node, count);
+ tmp->irq = res->start;
dev_info(&pdev->dev, "%d: Alloc irq: %d\n", count, tmp->irq);
}
list_add(&(tmp->list), &(local->mylist.list));
- }
-
+ } while (res);
of_prop = of_get_property(pdev->dev.of_node, "reset-gpio", NULL);
if (!of_prop) {
struct resource *res; /* IO mem resources */
int ret = 0;
struct irq_list *tmp;
- int count;
+ int count = 0;
struct zynq_rproc_pdata *local;
ret = cpu_down(1);
/* Init list for IRQs - it can be long list */
INIT_LIST_HEAD(&local->mylist.list);
- count = of_irq_count(pdev->dev.of_node);
/* Alloc IRQ based on DTS to be sure that no other driver will use it */
- while (count--) {
+ do {
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, count++);
+ if (!res)
+ break;
+
tmp = kzalloc(sizeof(struct irq_list), GFP_KERNEL);
if (!tmp) {
dev_err(&pdev->dev, "Unable to alloc irq list\n");
goto irq_fault;
}
- tmp->irq = irq_of_parse_and_map(pdev->dev.of_node, count);
+ tmp->irq = res->start;
dev_dbg(&pdev->dev, "%d: Alloc irq: %d\n", count, tmp->irq);
*/
gic_set_cpu(1, tmp->irq);
list_add(&(tmp->list), &(local->mylist.list));
- }
+ } while (res);
/* Allocate free IPI number */
of_prop = of_get_property(pdev->dev.of_node, "ipino", NULL);