linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Parsons <lost.distance@yahoo.com>
To: linux-kernel@vger.kernel.org
Cc: philipp.zabel@gmail.com, sameo@linux.intel.com,
	mad_soft@inbox.ru, koen@dominion.thruhere.net
Subject: [PATCH] mfd: asic3: Add to_irq() member to gpio_chip structure
Date: Tue, 31 Jan 2012 01:18:35 +0000 (GMT)	[thread overview]
Message-ID: <1327972715.82506.YahooMailClassic@web29004.mail.ird.yahoo.com> (raw)

The gpio_to_irq() macro is now defined as __gpio_to_irq() instead of IRQ_GPIO().
The __gpio_to_irq() function returns -ENXIO if the referenced gpio_chip
structure does not define a to_irq() member.
This is true of the asic3 gpio_chip structure, and thus calls to gpio_to_irq()
now fail (for example from the gpio-vbus module).
This patch defines the to_irq() member in the asic3 gpio_chip structure.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
---
diff -ru clean-3.3-rc1/drivers/mfd/asic3.c linux-3.3-rc1/drivers/mfd/asic3.c
--- clean-3.3-rc1/drivers/mfd/asic3.c	2012-01-19 23:04:48.000000000 +0000
+++ linux-3.3-rc1/drivers/mfd/asic3.c	2012-01-31 00:58:34.777451050 +0000
@@ -525,6 +525,11 @@
 	return;
 }
 
+static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+	return (offset < ASIC3_NUM_GPIOS) ? IRQ_BOARD_START + offset : -ENXIO;
+}
+
 static __init int asic3_gpio_probe(struct platform_device *pdev,
 				   u16 *gpio_config, int num)
 {
@@ -976,6 +981,7 @@
 	asic->gpio.set = asic3_gpio_set;
 	asic->gpio.direction_input = asic3_gpio_direction_input;
 	asic->gpio.direction_output = asic3_gpio_direction_output;
+	asic->gpio.to_irq = asic3_gpio_to_irq;
 
 	ret = asic3_gpio_probe(pdev,
 			       pdata->gpio_config,


             reply	other threads:[~2012-01-31  1:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31  1:18 Paul Parsons [this message]
2012-02-20 17:40 ` [PATCH] mfd: asic3: Add to_irq() member to gpio_chip structure Samuel Ortiz

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=1327972715.82506.YahooMailClassic@web29004.mail.ird.yahoo.com \
    --to=lost.distance@yahoo.com \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mad_soft@inbox.ru \
    --cc=philipp.zabel@gmail.com \
    --cc=sameo@linux.intel.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 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).