From patchwork Wed Mar 17 17:35:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 86481 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2HHaBLg004734 for ; Wed, 17 Mar 2010 17:36:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754806Ab0CQRfK (ORCPT ); Wed, 17 Mar 2010 13:35:10 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:2037 "EHLO g1t0027.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753620Ab0CQRfG (ORCPT ); Wed, 17 Mar 2010 13:35:06 -0400 Received: from g1t0038.austin.hp.com (g1t0038.austin.hp.com [16.236.32.44]) by g1t0027.austin.hp.com (Postfix) with ESMTP id DA2D238426; Wed, 17 Mar 2010 17:35:05 +0000 (UTC) Received: from ldl (ldl.fc.hp.com [15.11.146.30]) by g1t0038.austin.hp.com (Postfix) with ESMTP id 9A88F30176; Wed, 17 Mar 2010 17:35:05 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 8779ECF004B; Wed, 17 Mar 2010 11:35:05 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uODzFB7U-0v3; Wed, 17 Mar 2010 11:35:05 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 72C69CF0010; Wed, 17 Mar 2010 11:35:05 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 5C14426189; Wed, 17 Mar 2010 11:35:05 -0600 (MDT) Subject: [PATCH 2/3] hpet: pass physical address, not entire hpet_data, to hpet_is_known() To: Clemens Ladisch From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, Vojtech Pavlik , linux-kernel@vger.kernel.org, "Venkatesh Pallipadi \(Venki\)" Date: Wed, 17 Mar 2010 11:35:05 -0600 Message-ID: <20100317173505.31124.74595.stgit@bob.kio> In-Reply-To: <20100317173329.31124.69795.stgit@bob.kio> References: <20100317173329.31124.69795.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 17 Mar 2010 17:36:11 +0000 (UTC) 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);