lkml.org 
[lkml]   [2014]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mfd: cottula: add cottula board
Date
On Monday 15 December 2014 00:10:06 Robert Jarzmik wrote:
> +
> + platform_set_drvdata(pdev, cot);
> + cot->gpio0 = gpiod_get(&pdev->dev, "lubbock_irq", 0);
> + if (IS_ERR(cot->gpio0)) {
> + dev_err(&pdev->dev, "Couldn't request GPIO : ret = %d\n", ret);
> + return PTR_ERR(cot->gpio0);
> + }
> + cot->irq = gpiod_to_irq(cot->gpio0);
> + if (cot->irq < 0)
> + return cot->irq;
> +
> + cot->irqdomain =
> + irq_domain_add_linear(pdev->dev.of_node, COTTULA_NB_IRQ,
> + &cottula_irq_domain_ops, cot);
> + if (!cot->irqdomain)
> + return -ENODEV;
> +
> + ret = 0;
> + if (base_irq)
> + ret = irq_create_strict_mappings(cot->irqdomain, base_irq, 0,
> + COTTULA_NB_IRQ);
>

This looks a bit ambiguous: You get a GPIO line for the purpose of the
IRQ nesting but don't use the GPIO otherwise, and you pass the device's
own irq domain start as an IORESOURCE_IRQ resource.

For consistency between DT and ATAGS based uses, and with similar DT
based drivers, I would instead recommend passing the parent irq (from
the GPIO) as an IORESOURCE_IRQ resource instead of a gpio lookup,
and passing the base_irq as platform_data for the ATAGS case.

Arnd


\
 
 \ /
  Last update: 2014-12-15 12:21    [W:0.212 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site