public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: linux-acpi@vger.kernel.org, Vojtech Pavlik <vojtech@suse.cz>,
	linux-kernel@vger.kernel.org,
	"Venkatesh Pallipadi (Venki)" <venkatesh.pallipadi@intel.com>
Subject: [PATCH 2/3] hpet: pass physical address, not entire hpet_data, to hpet_is_known()
Date: Wed, 17 Mar 2010 11:35:05 -0600	[thread overview]
Message-ID: <20100317173505.31124.74595.stgit@bob.kio> (raw)
In-Reply-To: <20100317173329.31124.69795.stgit@bob.kio>


No functional change; hpet_is_known() only needs the physical address,
so supplying that instead of the whole struct hpet_data makes the callers
a little simpler.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---

 drivers/char/hpet.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 65a9aa8..4c508df 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -662,12 +662,12 @@ static const struct file_operations hpet_fops = {
 	.mmap = hpet_mmap,
 };
 
-static int hpet_is_known(struct hpet_data *hdp)
+static int hpet_is_known(unsigned long phys_address)
 {
 	struct hpets *hpetp;
 
 	for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
-		if (hpetp->hp_hpet_phys == hdp->hd_phys_address)
+		if (hpetp->hp_hpet_phys == phys_address)
 			return 1;
 
 	return 0;
@@ -788,7 +788,7 @@ int hpet_alloc(struct hpet_data *hdp)
 	 * If platform dependent code has allocated the hpet that
 	 * ACPI has also reported, then we catch it here.
 	 */
-	if (hpet_is_known(hdp)) {
+	if (hpet_is_known(hdp->hd_phys_address)) {
 		printk(KERN_DEBUG "%s: duplicate HPET ignored\n",
 			__func__);
 		return 0;
@@ -911,9 +911,7 @@ static int hpet_pnp_add(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 	if (!mem)
 		return -ENODEV;
 
-	data.hd_phys_address = mem->start;
-
-	if (hpet_is_known(&data))
+	if (hpet_is_known(mem->start))
 		return -EBUSY;
 
 	i = 0;
@@ -925,6 +923,7 @@ static int hpet_pnp_add(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 	if (!data.hd_nirqs)
 		return -ENODEV;
 
+	data.hd_phys_address = mem->start;
 	data.hd_address = ioremap(mem->start, resource_size(mem));
 
 	return hpet_alloc(&data);

  parent reply	other threads:[~2010-03-17 17:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 17:34 [PATCH 0/3] hpet: convert from ACPI to PNP driver Bjorn Helgaas
2010-03-17 17:35 ` [PATCH 1/3] hpet: convert " Bjorn Helgaas
2010-03-17 22:18   ` Venkatesh Pallipadi
2010-03-17 23:00     ` Bjorn Helgaas
2010-03-17 17:35 ` Bjorn Helgaas [this message]
2010-03-18  7:27   ` [PATCH 2/3] hpet: pass physical address, not entire hpet_data, to hpet_is_known() Clemens Ladisch
2010-03-17 17:35 ` [PATCH 3/3] MAINTAINERS: remove obsolete HPET ACPI entry Bjorn Helgaas

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=20100317173505.31124.74595.stgit@bob.kio \
    --to=bjorn.helgaas@hp.com \
    --cc=clemens@ladisch.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=venkatesh.pallipadi@intel.com \
    --cc=vojtech@suse.cz \
    /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