mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Reimer <mreimer@vpop.net>
To: linux-kernel@vger.kernel.org
Cc: Matt Reimer <mreimer@vpop.net>
Subject: [PATCH 1/2] ds1wm: simplify platform_data
Date: Tue,  1 May 2007 15:00:55 -0700	[thread overview]
Message-ID: <1178056856620-git-send-email-mreimer@vpop.net> (raw)

Simplify ds1wm's platform_data by using IORESOURCE_IRQ_* flags rather
than the platform_data field active_high.

Signed-off-by: Matt Reimer <mreimer@vpop.net>
---
 drivers/w1/masters/ds1wm.c |   11 +++++++----
 include/linux/ds1wm.h      |    1 -
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index c3ea34d..8b08609 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -90,6 +90,7 @@ struct ds1wm_data {
 	struct platform_device *pdev;
 	struct ds1wm_platform_data *pdata;
 	int		irq;
+	int		active_high;
 	struct clk	*clk;
 	int		slave_present;
 	void		*reset_complete;
@@ -141,7 +142,7 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
 	ds1wm_data->reset_complete = &reset_done;
 
 	ds1wm_write_register(ds1wm_data, DS1WM_INT_EN, DS1WM_INTEN_EPD |
-		(ds1wm_data->pdata->active_high ? DS1WM_INTEN_IAS : 0));
+		(ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0));
 
 	ds1wm_write_register(ds1wm_data, DS1WM_CMD, DS1WM_CMD_1W_RESET);
 
@@ -163,7 +164,7 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
 
 	ds1wm_write_register(ds1wm_data, DS1WM_INT_EN,
 		DS1WM_INTEN_ERBF | DS1WM_INTEN_ETMT | DS1WM_INTEN_EPD |
-		(ds1wm_data->pdata->active_high ? DS1WM_INTEN_IAS : 0));
+		(ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0));
 
 	if (!ds1wm_data->slave_present) {
                 dev_dbg(&ds1wm_data->pdev->dev, "reset: no devices found\n");
@@ -356,9 +357,11 @@ static int ds1wm_probe(struct platform_device *pdev)
 		goto err1;
 	}
 	ds1wm_data->irq = res->start;
+	ds1wm_data->active_high = (res->flags & IORESOURCE_IRQ_HIGHEDGE) ?
+		1 : 0;
 
-	set_irq_type(ds1wm_data->irq, res->flags & IORESOURCE_IRQ_LOWEDGE ?
-			IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING);
+	set_irq_type(ds1wm_data->irq, ds1wm_data->active_high ?
+			IRQ_TYPE_EDGE_RISING : IRQ_TYPE_EDGE_FALLING);
 
 	ret = request_irq(ds1wm_data->irq, ds1wm_isr, IRQF_DISABLED,
 			  "ds1wm", ds1wm_data);
diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h
index feeb64d..31f6e3c 100644
--- a/include/linux/ds1wm.h
+++ b/include/linux/ds1wm.h
@@ -6,7 +6,6 @@ struct ds1wm_platform_data {
 			     * e.g. on h5xxx and h2200 this is 2
 			     * (registers aligned to 4-byte boundaries),
 			     * while on hx4700 this is 1 */
-	int active_high;    /* interrupt polarity, passed to DS1WM as IAS bit */
 	void (*enable)(struct platform_device *pdev);
 	void (*disable)(struct platform_device *pdev);
 };
-- 
1.5.1.1


             reply	other threads:[~2007-05-01 22:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-01 22:00 Matt Reimer [this message]
2007-05-01 22:00 ` [PATCH 2/2] ds1wm: disable interrupts when turning off ds1wm Matt Reimer

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=1178056856620-git-send-email-mreimer@vpop.net \
    --to=mreimer@vpop.net \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®