public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Uwe Kleine-K?nig <Uwe.Kleine-Koenig@digi.com>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	"Hans J. Koch" <hjk@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"gregkh@suse.de" <gregkh@suse.de>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [PATCH] uio_pdrv: Unique IRQ Mode
Date: Wed, 11 Jun 2008 02:32:53 +0900	[thread overview]
Message-ID: <20080610173253.GA21204@linux-sh.org> (raw)
In-Reply-To: <20080610071032.GB22814@digi.com>

On Tue, Jun 10, 2008 at 09:10:32AM +0200, Uwe Kleine-K?nig wrote:
> Signed-off-by: Uwe Kleine-K?nig <Uwe.Kleine-Koenig@digi.com>
> ---
>  include/linux/uio_driver.h |   33 +++++++++++++++++++++++++++++++++
>  1 files changed, 33 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
> index cdf338d..671a7a8 100644
> --- a/include/linux/uio_driver.h
> +++ b/include/linux/uio_driver.h
> @@ -63,6 +63,7 @@ struct uio_info {
>  	long			irq;
>  	unsigned long		irq_flags;
>  	void			*priv;
> +	unsigned int		flags;
>  	irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
>  	int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
>  	int (*open)(struct uio_info *info, struct inode *inode);

This should be unsigned long.

> @@ -92,4 +93,36 @@ extern void uio_event_notify(struct uio_info *info);
>  #define UIO_MEM_LOGICAL	2
>  #define UIO_MEM_VIRTUAL 3
>  
> +/* defines for uio_info->flags */
> +#define UIO_FLAGS_IRQDISABLED 0
> +
> +static inline irqreturn_t uio_userirq_handler(int irq,
> +		struct uio_info *dev_info)
> +{
> +	int ret;
> +
> +	if (likely(dev_info->irqcontrol)) {
> +		ret = dev_info->irqcontrol(dev_info, 0);
> +		if (ret) {
> +			pr_warning("%s: failed to disable irq\n", __func__);
> +			return IRQ_NONE;
> +		} else
> +			return IRQ_HANDLED;
> +	} else
> +		return IRQ_NONE;
> +}
> +
You can simplify this by just using IRQ_RETVAL() on
dev_info->irqcontrol(...). The printk() shouldn't be necessary, as the
other layers should already catch that.

  parent reply	other threads:[~2008-06-10 17:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-04  6:08 [PATCH] uio_pdrv: Unique IRQ Mode Magnus Damm
2008-06-04 10:11 ` Hans J. Koch
2008-06-05  1:25   ` Magnus Damm
2008-06-05  6:49     ` Uwe Kleine-König
2008-06-06  2:55       ` Magnus Damm
2008-06-06 10:04         ` Hans J. Koch
2008-06-08 10:03           ` Magnus Damm
2008-06-05  9:09     ` Hans J. Koch
2008-06-05  9:46       ` Magnus Damm
2008-06-05 11:27         ` Hans J. Koch
2008-06-08 10:19           ` Magnus Damm
2008-06-08 20:54             ` Hans J. Koch
2008-06-09  1:12               ` Magnus Damm
2008-06-09  8:44                 ` Hans J. Koch
2008-06-09  9:01                   ` Paul Mundt
2008-06-09 12:34                     ` Uwe Kleine-König
2008-06-10  3:12                       ` Greg KH
2008-06-10  4:40                       ` Magnus Damm
2008-06-10  7:10                         ` Uwe Kleine-König
2008-06-10  7:14                           ` [PATCH] UIO: minor style and comment fixes Uwe Kleine-König
2008-06-10  9:07                             ` Hans J. Koch
2008-06-10 13:50                           ` [PATCH] uio_pdrv: Unique IRQ Mode Magnus Damm
2008-06-10 17:32                           ` Paul Mundt [this message]
2008-06-10 19:24                             ` Uwe Kleine-König
2008-06-09  4:09               ` Paul Mundt
2008-06-09  7:57               ` Uwe Kleine-König
2008-06-09  8:00                 ` Paul Mundt
2008-06-09  9:54                 ` Hans J. Koch
2008-06-09 12:32                   ` Uwe Kleine-König
2008-06-09 14:20                     ` Hans J. Koch
2008-06-10  6:11                       ` Uwe Kleine-König
2008-06-10  9:01                         ` Hans J. Koch
2008-06-05 11:33         ` Uwe Kleine-König

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=20080610173253.GA21204@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=Uwe.Kleine-Koenig@digi.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox