public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l@tiscali•nl>
To: jwboyer@linux•vnet.ibm.com
Cc: linuxppc-dev@ozlabs•org
Subject: [PATCH] balance ioremap/iounmap in {sycamore, walnut}_setup_arch()
Date: Thu, 08 Nov 2007 17:33:45 +0100	[thread overview]
Message-ID: <47333A69.3030606@tiscali.nl> (raw)

I guess it should be done after the last usage of kb_data or fpga_status?
--
Balance ioremap/iounmap

Signed-off-by: Roel Kluin <12o3l@tiscali•nl>
---
diff --git a/arch/ppc/platforms/4xx/sycamore.c b/arch/ppc/platforms/4xx/sycamore.c
index 8689f3e..4f3bac1 100644
--- a/arch/ppc/platforms/4xx/sycamore.c
+++ b/arch/ppc/platforms/4xx/sycamore.c
@@ -99,28 +99,30 @@ sycamore_setup_arch(void)
 	kb_data = ioremap(SYCAMORE_PS2_BASE, 8);
 	if (!kb_data) {
 		printk(KERN_CRIT
 		       "sycamore_setup_arch() kb_data ioremap failed\n");
 		return;
 	}
 
 	kb_cs = kb_data + 1;
+	iounmap(kb_data);
 
 	fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
 	if (!fpga_status) {
 		printk(KERN_CRIT
 		       "sycamore_setup_arch() fpga_status ioremap failed\n");
 		return;
 	}
 
 	fpga_enable = fpga_status + 1;
 	fpga_polarity = fpga_status + 2;
 	fpga_trigger = fpga_status + 3;
 	fpga_brdc = fpga_status + 4;
+	iounmap(fpga_status);
 
 	/* split the keyboard and mouse interrupts */
 	fpga_brdc_data = readb(fpga_brdc);
 	fpga_brdc_data |= 0x80;
 	writeb(fpga_brdc_data, fpga_brdc);
 
 	writeb(0x3, fpga_enable);
 
diff --git a/arch/ppc/platforms/4xx/walnut.c b/arch/ppc/platforms/4xx/walnut.c
index 2f97723..8cfeb94 100644
--- a/arch/ppc/platforms/4xx/walnut.c
+++ b/arch/ppc/platforms/4xx/walnut.c
@@ -81,28 +81,30 @@ walnut_setup_arch(void)
 	kb_data = ioremap(WALNUT_PS2_BASE, 8);
 	if (!kb_data) {
 		printk(KERN_CRIT
 		       "walnut_setup_arch() kb_data ioremap failed\n");
 		return;
 	}
 
 	kb_cs = kb_data + 1;
+	iounmap(kb_data);
 
 	fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
 	if (!fpga_status) {
 		printk(KERN_CRIT
 		       "walnut_setup_arch() fpga_status ioremap failed\n");
 		return;
 	}
 
 	fpga_enable = fpga_status + 1;
 	fpga_polarity = fpga_status + 2;
 	fpga_trigger = fpga_status + 3;
 	fpga_brdc = fpga_status + 4;
+	iounmap(fpga_status);
 
 	/* split the keyboard and mouse interrupts */
 	fpga_brdc_data = readb(fpga_brdc);
 	fpga_brdc_data |= 0x80;
 	writeb(fpga_brdc_data, fpga_brdc);
 
 	writeb(0x3, fpga_enable);
 

             reply	other threads:[~2007-11-08 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08 16:33 Roel Kluin [this message]
2007-11-08 16:52 ` [PATCH] balance ioremap/iounmap in {sycamore, walnut}_setup_arch() Valentine Barshak
2007-11-09 12:32   ` Roel Kluin

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=47333A69.3030606@tiscali.nl \
    --to=12o3l@tiscali$(echo .)nl \
    --cc=jwboyer@linux$(echo .)vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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