All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@hansjkoch.de>
To: Benedikt Spranger <b.spranger@linutronix.de>
Cc: hjk@hansjkoch.de, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, magnus.damm@gmail.com
Subject: Re: [PATCH] uio_pdrv_genirq: get irq through platform resource if not set otherwise
Date: Mon, 14 May 2012 22:56:28 +0200	[thread overview]
Message-ID: <20120514205627.GC6153@local> (raw)
In-Reply-To: <1337014097-5034-2-git-send-email-b.spranger@linutronix.de>

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

  reply	other threads:[~2012-05-14 21:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-05-15  2:37   ` Magnus Damm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120514205627.GC6153@local \
    --to=hjk@hansjkoch.de \
    --cc=b.spranger@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.