linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uio_pdrv_genirq: configure irq through platform resource
@ 2012-05-14 16:48 Benedikt Spranger
  2012-05-14 16:48 ` [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise Benedikt Spranger
  0 siblings, 1 reply; 4+ messages in thread
From: Benedikt Spranger @ 2012-05-14 16:48 UTC (permalink / raw)
  To: hjk; +Cc: gregkh, linux-kernel, magnus.damm, Benedikt Spranger

The platform driver uio_pdrv_genirq use its own method to configure the
interrupt number. Instead of using the common way via platform resource the
interrupt number is passed through the platform_data. Parse also the interrupt
resource to allow a platform device to pass the interrupt number via
platform resource.

Benedikt Spranger (1):
  uio_pdrv_genirq: get irq through platform resource if not set
    otherwise

 drivers/uio/uio_pdrv_genirq.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

-- 
1.7.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise
  2012-05-14 16:48 [PATCH] uio_pdrv_genirq: configure irq through platform resource Benedikt Spranger
@ 2012-05-14 16:48 ` Benedikt Spranger
  2012-05-14 20:56   ` Hans J. Koch
  2012-05-15  2:37   ` Magnus Damm
  0 siblings, 2 replies; 4+ messages in thread
From: Benedikt Spranger @ 2012-05-14 16:48 UTC (permalink / raw)
  To: hjk; +Cc: gregkh, linux-kernel, magnus.damm, Benedikt Spranger

Platform devices are configured through platform resources. The interrupt
in the driver uio_pdrv_genirq is instead configured through a side channel
i.e. the platform data structure. Make it possible to use the generic
configuration scheme via platform resource.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
---
 drivers/uio/uio_pdrv_genirq.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index b98371d..42202cd 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -146,6 +146,14 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
 	priv->flags = 0; /* interrupt is enabled to begin with */
 	priv->pdev = pdev;
 
+	if (!uioinfo->irq) {
+		ret = platform_get_irq(pdev, 0);
+		if (ret < 0) {
+			dev_err(&pdev->dev, "failed to get IRQ\n");
+			goto bad0;
+		}
+		uioinfo->irq = ret;
+	}
 	uiomem = &uioinfo->mem[0];
 
 	for (i = 0; i < pdev->num_resources; ++i) {
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise
  2012-05-14 16:48 ` [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise Benedikt Spranger
@ 2012-05-14 20:56   ` Hans J. Koch
  2012-05-15  2:37   ` Magnus Damm
  1 sibling, 0 replies; 4+ messages in thread
From: Hans J. Koch @ 2012-05-14 20:56 UTC (permalink / raw)
  To: Benedikt Spranger; +Cc: hjk, gregkh, linux-kernel, magnus.damm

On Mon, May 14, 2012 at 06:48:17PM +0200, Benedikt Spranger wrote:
> Platform devices are configured through platform resources. The interrupt
> in the driver uio_pdrv_genirq is instead configured through a side channel
> i.e. the platform data structure. Make it possible to use the generic
> configuration scheme via platform resource.

Looks alright to me.

> 
> Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>

Signed-off-by: "Hans J. Koch" <hjk@hansjkoch.de>

> ---
>  drivers/uio/uio_pdrv_genirq.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
> index b98371d..42202cd 100644
> --- a/drivers/uio/uio_pdrv_genirq.c
> +++ b/drivers/uio/uio_pdrv_genirq.c
> @@ -146,6 +146,14 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
>  	priv->flags = 0; /* interrupt is enabled to begin with */
>  	priv->pdev = pdev;
>  
> +	if (!uioinfo->irq) {
> +		ret = platform_get_irq(pdev, 0);
> +		if (ret < 0) {
> +			dev_err(&pdev->dev, "failed to get IRQ\n");
> +			goto bad0;
> +		}
> +		uioinfo->irq = ret;
> +	}
>  	uiomem = &uioinfo->mem[0];
>  
>  	for (i = 0; i < pdev->num_resources; ++i) {
> -- 
> 1.7.9.1
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise
  2012-05-14 16:48 ` [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise Benedikt Spranger
  2012-05-14 20:56   ` Hans J. Koch
@ 2012-05-15  2:37   ` Magnus Damm
  1 sibling, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2012-05-15  2:37 UTC (permalink / raw)
  To: Benedikt Spranger; +Cc: hjk, gregkh, linux-kernel

On Tue, May 15, 2012 at 1:48 AM, Benedikt Spranger
<b.spranger@linutronix.de> wrote:
> Platform devices are configured through platform resources. The interrupt
> in the driver uio_pdrv_genirq is instead configured through a side channel
> i.e. the platform data structure. Make it possible to use the generic
> configuration scheme via platform resource.
>
> Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
> ---
>  drivers/uio/uio_pdrv_genirq.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)

Looks fine to me, thank you!

Acked-by: Magnus Damm <damm@opensource.se>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-15  2:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 16:48 [PATCH] uio_pdrv_genirq: configure irq through platform resource Benedikt Spranger
2012-05-14 16:48 ` [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise Benedikt Spranger
2012-05-14 20:56   ` Hans J. Koch
2012-05-15  2:37   ` Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).