All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@nokia.com>
To: "ext Menon, Nishanth" <nm@ti.com>
Cc: "Pandita, Vikram" <vikram.pandita@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/2] Serial: Define IRQ flags for 8250 driver
Date: Fri, 12 Jun 2009 09:37:43 +0300	[thread overview]
Message-ID: <20090612063743.GA655@nokia.com> (raw)
In-Reply-To: <7A436F7769CA33409C6B44B358BFFF0C0115CBC08A@dlee02.ent.ti.com>

On Fri, Jun 12, 2009 at 03:46:37AM +0200, ext Menon, Nishanth wrote:
> 
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > owner@vger.kernel.org] On Behalf Of Pandita, Vikram
> > Sent: Thursday, June 11, 2009 7:50 PM
> > To: linux-omap@vger.kernel.org
> > Cc: Pandita, Vikram
> > Subject: [PATCH 1/2] Serial: Define IRQ flags for 8250 driver
> > 
> > 
> > +	/* Get IRQ Trigger Flag */
> > +	if (up->port.flags & UPF_IRQ_TRIG_RISING)
> > +		irq_flags |= IRQF_TRIGGER_RISING;
> > +	else if (up->port.flags & UPF_IRQ_TRIG_FALLING)
> > +		irq_flags |= IRQF_TRIGGER_FALLING;
> > +	else if (up->port.flags & UPF_IRQ_TRIG_HIGH)
> > +		irq_flags |= IRQF_TRIGGER_HIGH;
> > +	else if (up->port.flags & UPF_IRQ_TRIG_LOW)
> > +		irq_flags |= IRQF_TRIGGER_LOW;
> > +
> Blame it on my dislike for nested if elseif, but...
> irq_flags |= 
> 	(up->port.flags & UPF_IRQ_TRIG_RISING)? IRQF_TRIGGER_RISING :
> 	(up->port.flags & UPF_IRQ_TRIG_FALLING)? IRQF_TRIGGER_FALLING :
> 	(up->port.flags & IRQF_TRIGGER_HIGH)? IRQF_TRIGGER_HIGH :
> 	(up->port.flags & UPF_IRQ_TRIG_LOW)? IRQF_TRIGGER_LOW : 0;
> 
> Makes sense?

switch (up->port.flags & UPF_IRQ_FLAGS_MASK) {
case UPF_IRQ_TRIG_RISING:
	irq_flags |= IRQF_TRIGGER_RISING;
	break;
case UPF_IRQ_TRIG_FALLING:
	irq_flags |= IRQF_TRIGGER_FALLING;
	break;
case UPF_IRQ_TRIG_HIGH:
	irq_flags |= IRQF_TRIGGER_HIGH;
	break;
case UPF_IRQ_TRIG_LOW:
	irq_flags |= IRQF_TRIGGER_LOW;
	break;
default:
	printk(KERN_ERR "Unsupported flag\n");
	return -EINVAL;
}

???

-- 
balbi

  reply	other threads:[~2009-06-12  6:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12  0:49 [PATCH 1/2] Serial: Define IRQ flags for 8250 driver Vikram Pandita
2009-06-12  1:46 ` Menon, Nishanth
2009-06-12  6:37   ` Felipe Balbi [this message]
2009-06-12 14:45     ` Menon, Nishanth
2009-06-12 14:50       ` Pandita, Vikram
2009-06-12 14:54         ` Menon, Nishanth
2009-06-12 19:01         ` Felipe Balbi
2009-06-12 19:11           ` Pandita, Vikram
2009-06-12 23:13           ` Felipe Contreras
  -- strict thread matches above, loose matches on Subject: below --
2009-06-12  0:53 Vikram Pandita
2009-06-12 16:26 ` Marc Zyngier
2009-06-12 16:47 ` Kevin Hilman

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=20090612063743.GA655@nokia.com \
    --to=felipe.balbi@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=vikram.pandita@ti.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.