2012-05-14 16:48:29

by Benedikt Spranger

[permalink] [raw]
Subject: [PATCH] uio_pdrv_genirq: configure irq through platform resource

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


2012-05-14 16:48:30

by Benedikt Spranger

[permalink] [raw]
Subject: [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise

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 <[email protected]>
---
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

2012-05-14 21:26:15

by Hans J. Koch

[permalink] [raw]
Subject: Re: [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise

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 <[email protected]>

Signed-off-by: "Hans J. Koch" <[email protected]>

> ---
> 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
>
>

2012-05-15 02:37:06

by Magnus Damm

[permalink] [raw]
Subject: Re: [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise

On Tue, May 15, 2012 at 1:48 AM, Benedikt Spranger
<[email protected]> 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 <[email protected]>
> ---
> ?drivers/uio/uio_pdrv_genirq.c | ? ?8 ++++++++
> ?1 files changed, 8 insertions(+), 0 deletions(-)

Looks fine to me, thank you!

Acked-by: Magnus Damm <[email protected]>