aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
author <greg@echidna.(none)>2005-09-05 12:20:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-05 12:20:31 -0400
commit4e0c64cfc1126a2946487d4771168458bb9ba9be (patch)
tree1825887c36f029ca795561cc428fd6a2585cb5fa /drivers
parentfae91e72b79ba9a21f0ce7551a1fd7e8984c85a6 (diff)
parent67d2c36e901403bb97cb79ddb44d702c3284d0ba (diff)
Merge HEAD from gregkh@master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6.git
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/watchdog/Makefile71
-rw-r--r--drivers/char/watchdog/ixp2000_wdt.c2
-rw-r--r--drivers/char/watchdog/ixp4xx_wdt.c2
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c87
-rw-r--r--drivers/char/watchdog/scx200_wdt.c2
-rw-r--r--drivers/char/watchdog/softdog.c13
-rw-r--r--drivers/char/watchdog/w83627hf_wdt.c6
-rw-r--r--drivers/scsi/ahci.c52
-rw-r--r--drivers/scsi/ata_piix.c11
-rw-r--r--drivers/scsi/libata-core.c15
-rw-r--r--drivers/scsi/libata-scsi.c8
-rw-r--r--drivers/scsi/libata.h1
-rw-r--r--drivers/scsi/sata_nv.c9
-rw-r--r--drivers/scsi/sata_promise.c20
-rw-r--r--drivers/scsi/sata_qstor.c8
-rw-r--r--drivers/scsi/sata_sil.c12
-rw-r--r--drivers/scsi/sata_svw.c7
-rw-r--r--drivers/scsi/sata_sx4.c54
-rw-r--r--drivers/scsi/sata_vsc.c5
19 files changed, 224 insertions, 161 deletions
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
index b16dfea28134..cfeac6f10137 100644
--- a/drivers/char/watchdog/Makefile
+++ b/drivers/char/watchdog/Makefile
@@ -2,43 +2,68 @@
2# Makefile for the WatchDog device drivers. 2# Makefile for the WatchDog device drivers.
3# 3#
4 4
5# Only one watchdog can succeed. We probe the ISA/PCI/USB based
6# watchdog-cards first, then the architecture specific watchdog
7# drivers and then the architecture independant "softdog" driver.
8# This means that if your ISA/PCI/USB card isn't detected that
9# you can fall back to an architecture specific driver and if
10# that also fails then you can fall back to the software watchdog
11# to give you some cover.
12
13# ISA-based Watchdog Cards
5obj-$(CONFIG_PCWATCHDOG) += pcwd.o 14obj-$(CONFIG_PCWATCHDOG) += pcwd.o
6obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
7obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
8obj-$(CONFIG_IB700_WDT) += ib700wdt.o
9obj-$(CONFIG_MIXCOMWD) += mixcomwd.o 15obj-$(CONFIG_MIXCOMWD) += mixcomwd.o
10obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
11obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
12obj-$(CONFIG_WDT) += wdt.o 16obj-$(CONFIG_WDT) += wdt.o
17
18# PCI-based Watchdog Cards
19obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o
13obj-$(CONFIG_WDTPCI) += wdt_pci.o 20obj-$(CONFIG_WDTPCI) += wdt_pci.o
21
22# USB-based Watchdog Cards
23obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
24
25# ARM Architecture
14obj-$(CONFIG_21285_WATCHDOG) += wdt285.o 26obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
15obj-$(CONFIG_977_WATCHDOG) += wdt977.o 27obj-$(CONFIG_977_WATCHDOG) += wdt977.o
16obj-$(CONFIG_I8XX_TCO) += i8xx_tco.o 28obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
17obj-$(CONFIG_MACHZ_WDT) += machzwd.o 29obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
18obj-$(CONFIG_SH_WDT) += shwdt.o
19obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o 30obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
20obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o 31obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
21obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o 32
22obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o 33# X86 (i386 + ia64 + x86_64) Architecture
23obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o 34obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
24obj-$(CONFIG_SC520_WDT) += sc520_wdt.o 35obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
25obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
26obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o 36obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o
27obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o 37obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
38obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
39obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
40obj-$(CONFIG_IB700_WDT) += ib700wdt.o
28obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o 41obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
42obj-$(CONFIG_I8XX_TCO) += i8xx_tco.o
43obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
44obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
45obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
29obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o 46obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
30obj-$(CONFIG_INDYDOG) += indydog.o 47obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o
31obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o 48obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
32obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o 49obj-$(CONFIG_MACHZ_WDT) += machzwd.o
33obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o 50
34obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o 51# PowerPC Architecture
35obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o 52obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
53
54# PPC64 Architecture
36obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o 55obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o
37obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o 56obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
38 57
39# Only one watchdog can succeed. We probe the hardware watchdog 58# MIPS Architecture
40# drivers first, then the softdog driver. This means if your hardware 59obj-$(CONFIG_INDYDOG) += indydog.o
41# watchdog dies or is 'borrowed' for some reason the software watchdog 60
42# still gives you some cover. 61# S390 Architecture
62
63# SUPERH Architecture
64obj-$(CONFIG_SH_WDT) += shwdt.o
65
66# SPARC64 Architecture
43 67
68# Architecture Independant
44obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o 69obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
index e7640bc4904b..0cfb9b9c4a4b 100644
--- a/drivers/char/watchdog/ixp2000_wdt.c
+++ b/drivers/char/watchdog/ixp2000_wdt.c
@@ -182,7 +182,7 @@ static struct file_operations ixp2000_wdt_fops =
182static struct miscdevice ixp2000_wdt_miscdev = 182static struct miscdevice ixp2000_wdt_miscdev =
183{ 183{
184 .minor = WATCHDOG_MINOR, 184 .minor = WATCHDOG_MINOR,
185 .name = "IXP2000 Watchdog", 185 .name = "watchdog",
186 .fops = &ixp2000_wdt_fops, 186 .fops = &ixp2000_wdt_fops,
187}; 187};
188 188
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c
index 8d916afbf4fa..b5be8b11104a 100644
--- a/drivers/char/watchdog/ixp4xx_wdt.c
+++ b/drivers/char/watchdog/ixp4xx_wdt.c
@@ -176,7 +176,7 @@ static struct file_operations ixp4xx_wdt_fops =
176static struct miscdevice ixp4xx_wdt_miscdev = 176static struct miscdevice ixp4xx_wdt_miscdev =
177{ 177{
178 .minor = WATCHDOG_MINOR, 178 .minor = WATCHDOG_MINOR,
179 .name = "IXP4xx Watchdog", 179 .name = "watchdog",
180 .fops = &ixp4xx_wdt_fops, 180 .fops = &ixp4xx_wdt_fops,
181}; 181};
182 182
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index f85ac898a49a..8b292bf343c4 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -27,7 +27,10 @@
27 * Fixed tmr_count / wdt_count confusion 27 * Fixed tmr_count / wdt_count confusion
28 * Added configurable debug 28 * Added configurable debug
29 * 29 *
30 * 11-Jan-2004 BJD Fixed divide-by-2 in timeout code 30 * 11-Jan-2005 BJD Fixed divide-by-2 in timeout code
31 *
32 * 25-Jan-2005 DA Added suspend/resume support
33 * Replaced reboot notifier with .shutdown method
31 * 34 *
32 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 35 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
33*/ 36*/
@@ -40,8 +43,6 @@
40#include <linux/miscdevice.h> 43#include <linux/miscdevice.h>
41#include <linux/watchdog.h> 44#include <linux/watchdog.h>
42#include <linux/fs.h> 45#include <linux/fs.h>
43#include <linux/notifier.h>
44#include <linux/reboot.h>
45#include <linux/init.h> 46#include <linux/init.h>
46#include <linux/device.h> 47#include <linux/device.h>
47#include <linux/interrupt.h> 48#include <linux/interrupt.h>
@@ -317,20 +318,6 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
317 } 318 }
318} 319}
319 320
320/*
321 * Notifier for system down
322 */
323
324static int s3c2410wdt_notify_sys(struct notifier_block *this, unsigned long code,
325 void *unused)
326{
327 if(code==SYS_DOWN || code==SYS_HALT) {
328 /* Turn the WDT off */
329 s3c2410wdt_stop();
330 }
331 return NOTIFY_DONE;
332}
333
334/* kernel interface */ 321/* kernel interface */
335 322
336static struct file_operations s3c2410wdt_fops = { 323static struct file_operations s3c2410wdt_fops = {
@@ -348,10 +335,6 @@ static struct miscdevice s3c2410wdt_miscdev = {
348 .fops = &s3c2410wdt_fops, 335 .fops = &s3c2410wdt_fops,
349}; 336};
350 337
351static struct notifier_block s3c2410wdt_notifier = {
352 .notifier_call = s3c2410wdt_notify_sys,
353};
354
355/* interrupt handler code */ 338/* interrupt handler code */
356 339
357static irqreturn_t s3c2410wdt_irq(int irqno, void *param, 340static irqreturn_t s3c2410wdt_irq(int irqno, void *param,
@@ -432,18 +415,10 @@ static int s3c2410wdt_probe(struct device *dev)
432 } 415 }
433 } 416 }
434 417
435 ret = register_reboot_notifier(&s3c2410wdt_notifier);
436 if (ret) {
437 printk (KERN_ERR PFX "cannot register reboot notifier (%d)\n",
438 ret);
439 return ret;
440 }
441
442 ret = misc_register(&s3c2410wdt_miscdev); 418 ret = misc_register(&s3c2410wdt_miscdev);
443 if (ret) { 419 if (ret) {
444 printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n", 420 printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n",
445 WATCHDOG_MINOR, ret); 421 WATCHDOG_MINOR, ret);
446 unregister_reboot_notifier(&s3c2410wdt_notifier);
447 return ret; 422 return ret;
448 } 423 }
449 424
@@ -479,15 +454,63 @@ static int s3c2410wdt_remove(struct device *dev)
479 return 0; 454 return 0;
480} 455}
481 456
457static void s3c2410wdt_shutdown(struct device *dev)
458{
459 s3c2410wdt_stop();
460}
461
462#ifdef CONFIG_PM
463
464static unsigned long wtcon_save;
465static unsigned long wtdat_save;
466
467static int s3c2410wdt_suspend(struct device *dev, u32 state, u32 level)
468{
469 if (level == SUSPEND_POWER_DOWN) {
470 /* Save watchdog state, and turn it off. */
471 wtcon_save = readl(wdt_base + S3C2410_WTCON);
472 wtdat_save = readl(wdt_base + S3C2410_WTDAT);
473
474 /* Note that WTCNT doesn't need to be saved. */
475 s3c2410wdt_stop();
476 }
477
478 return 0;
479}
480
481static int s3c2410wdt_resume(struct device *dev, u32 level)
482{
483 if (level == RESUME_POWER_ON) {
484 /* Restore watchdog state. */
485
486 writel(wtdat_save, wdt_base + S3C2410_WTDAT);
487 writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */
488 writel(wtcon_save, wdt_base + S3C2410_WTCON);
489
490 printk(KERN_INFO PFX "watchdog %sabled\n",
491 (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis");
492 }
493
494 return 0;
495}
496
497#else
498#define s3c2410wdt_suspend NULL
499#define s3c2410wdt_resume NULL
500#endif /* CONFIG_PM */
501
502
482static struct device_driver s3c2410wdt_driver = { 503static struct device_driver s3c2410wdt_driver = {
483 .name = "s3c2410-wdt", 504 .name = "s3c2410-wdt",
484 .bus = &platform_bus_type, 505 .bus = &platform_bus_type,
485 .probe = s3c2410wdt_probe, 506 .probe = s3c2410wdt_probe,
486 .remove = s3c2410wdt_remove, 507 .remove = s3c2410wdt_remove,
508 .shutdown = s3c2410wdt_shutdown,
509 .suspend = s3c2410wdt_suspend,
510 .resume = s3c2410wdt_resume,
487}; 511};
488 512
489 513
490
491static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; 514static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n";
492 515
493static int __init watchdog_init(void) 516static int __init watchdog_init(void)
@@ -499,13 +522,13 @@ static int __init watchdog_init(void)
499static void __exit watchdog_exit(void) 522static void __exit watchdog_exit(void)
500{ 523{
501 driver_unregister(&s3c2410wdt_driver); 524 driver_unregister(&s3c2410wdt_driver);
502 unregister_reboot_notifier(&s3c2410wdt_notifier);
503} 525}
504 526
505module_init(watchdog_init); 527module_init(watchdog_init);
506module_exit(watchdog_exit); 528module_exit(watchdog_exit);
507 529
508MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 530MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, "
531 "Dimitry Andric <dimitry.andric@tomtom.com>");
509MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver"); 532MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver");
510MODULE_LICENSE("GPL"); 533MODULE_LICENSE("GPL");
511MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 534MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
index c4568569f3a8..b4a102a2d7e3 100644
--- a/drivers/char/watchdog/scx200_wdt.c
+++ b/drivers/char/watchdog/scx200_wdt.c
@@ -206,7 +206,7 @@ static struct file_operations scx200_wdt_fops = {
206 206
207static struct miscdevice scx200_wdt_miscdev = { 207static struct miscdevice scx200_wdt_miscdev = {
208 .minor = WATCHDOG_MINOR, 208 .minor = WATCHDOG_MINOR,
209 .name = NAME, 209 .name = "watchdog",
210 .fops = &scx200_wdt_fops, 210 .fops = &scx200_wdt_fops,
211}; 211};
212 212
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
index 4d7ed931f5c6..20e5eb8667f2 100644
--- a/drivers/char/watchdog/softdog.c
+++ b/drivers/char/watchdog/softdog.c
@@ -77,7 +77,7 @@ static void watchdog_fire(unsigned long);
77 77
78static struct timer_list watchdog_ticktock = 78static struct timer_list watchdog_ticktock =
79 TIMER_INITIALIZER(watchdog_fire, 0, 0); 79 TIMER_INITIALIZER(watchdog_fire, 0, 0);
80static unsigned long timer_alive; 80static unsigned long driver_open, orphan_timer;
81static char expect_close; 81static char expect_close;
82 82
83 83
@@ -87,6 +87,9 @@ static char expect_close;
87 87
88static void watchdog_fire(unsigned long data) 88static void watchdog_fire(unsigned long data)
89{ 89{
90 if (test_and_clear_bit(0, &orphan_timer))
91 module_put(THIS_MODULE);
92
90 if (soft_noboot) 93 if (soft_noboot)
91 printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n"); 94 printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n");
92 else 95 else
@@ -128,9 +131,9 @@ static int softdog_set_heartbeat(int t)
128 131
129static int softdog_open(struct inode *inode, struct file *file) 132static int softdog_open(struct inode *inode, struct file *file)
130{ 133{
131 if(test_and_set_bit(0, &timer_alive)) 134 if (test_and_set_bit(0, &driver_open))
132 return -EBUSY; 135 return -EBUSY;
133 if (nowayout) 136 if (!test_and_clear_bit(0, &orphan_timer))
134 __module_get(THIS_MODULE); 137 __module_get(THIS_MODULE);
135 /* 138 /*
136 * Activate timer 139 * Activate timer
@@ -147,11 +150,13 @@ static int softdog_release(struct inode *inode, struct file *file)
147 */ 150 */
148 if (expect_close == 42) { 151 if (expect_close == 42) {
149 softdog_stop(); 152 softdog_stop();
153 module_put(THIS_MODULE);
150 } else { 154 } else {
151 printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); 155 printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
156 set_bit(0, &orphan_timer);
152 softdog_keepalive(); 157 softdog_keepalive();
153 } 158 }
154 clear_bit(0, &timer_alive); 159 clear_bit(0, &driver_open);
155 expect_close = 0; 160 expect_close = 0;
156 return 0; 161 return 0;
157} 162}
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c
index 465e0fd0423d..b5d821015421 100644
--- a/drivers/char/watchdog/w83627hf_wdt.c
+++ b/drivers/char/watchdog/w83627hf_wdt.c
@@ -93,6 +93,12 @@ w83627hf_init(void)
93 93
94 w83627hf_select_wd_register(); 94 w83627hf_select_wd_register();
95 95
96 outb_p(0xF6, WDT_EFER); /* Select CRF6 */
97 t=inb_p(WDT_EFDR); /* read CRF6 */
98 if (t != 0) {
99 printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
100 outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */
101 }
96 outb_p(0xF5, WDT_EFER); /* Select CRF5 */ 102 outb_p(0xF5, WDT_EFER); /* Select CRF5 */
97 t=inb_p(WDT_EFDR); /* read CRF5 */ 103 t=inb_p(WDT_EFDR); /* read CRF5 */
98 t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */ 104 t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index 179c95c878ac..31065261de8e 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -189,7 +189,6 @@ static void ahci_irq_clear(struct ata_port *ap);
189static void ahci_eng_timeout(struct ata_port *ap); 189static void ahci_eng_timeout(struct ata_port *ap);
190static int ahci_port_start(struct ata_port *ap); 190static int ahci_port_start(struct ata_port *ap);
191static void ahci_port_stop(struct ata_port *ap); 191static void ahci_port_stop(struct ata_port *ap);
192static void ahci_host_stop(struct ata_host_set *host_set);
193static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 192static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
194static void ahci_qc_prep(struct ata_queued_cmd *qc); 193static void ahci_qc_prep(struct ata_queued_cmd *qc);
195static u8 ahci_check_status(struct ata_port *ap); 194static u8 ahci_check_status(struct ata_port *ap);
@@ -242,7 +241,6 @@ static struct ata_port_operations ahci_ops = {
242 241
243 .port_start = ahci_port_start, 242 .port_start = ahci_port_start,
244 .port_stop = ahci_port_stop, 243 .port_stop = ahci_port_stop,
245 .host_stop = ahci_host_stop,
246}; 244};
247 245
248static struct ata_port_info ahci_port_info[] = { 246static struct ata_port_info ahci_port_info[] = {
@@ -296,17 +294,9 @@ static inline unsigned long ahci_port_base_ul (unsigned long base, unsigned int
296 return base + 0x100 + (port * 0x80); 294 return base + 0x100 + (port * 0x80);
297} 295}
298 296
299static inline void *ahci_port_base (void *base, unsigned int port) 297static inline void __iomem *ahci_port_base (void __iomem *base, unsigned int port)
300{ 298{
301 return (void *) ahci_port_base_ul((unsigned long)base, port); 299 return (void __iomem *) ahci_port_base_ul((unsigned long)base, port);
302}
303
304static void ahci_host_stop(struct ata_host_set *host_set)
305{
306 struct ahci_host_priv *hpriv = host_set->private_data;
307 kfree(hpriv);
308
309 ata_host_stop(host_set);
310} 300}
311 301
312static int ahci_port_start(struct ata_port *ap) 302static int ahci_port_start(struct ata_port *ap)
@@ -314,8 +304,9 @@ static int ahci_port_start(struct ata_port *ap)
314 struct device *dev = ap->host_set->dev; 304 struct device *dev = ap->host_set->dev;
315 struct ahci_host_priv *hpriv = ap->host_set->private_data; 305 struct ahci_host_priv *hpriv = ap->host_set->private_data;
316 struct ahci_port_priv *pp; 306 struct ahci_port_priv *pp;
317 void *mem, *mmio = ap->host_set->mmio_base; 307 void __iomem *mmio = ap->host_set->mmio_base;
318 void *port_mmio = ahci_port_base(mmio, ap->port_no); 308 void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
309 void *mem;
319 dma_addr_t mem_dma; 310 dma_addr_t mem_dma;
320 311
321 pp = kmalloc(sizeof(*pp), GFP_KERNEL); 312 pp = kmalloc(sizeof(*pp), GFP_KERNEL);
@@ -383,8 +374,8 @@ static void ahci_port_stop(struct ata_port *ap)
383{ 374{
384 struct device *dev = ap->host_set->dev; 375 struct device *dev = ap->host_set->dev;
385 struct ahci_port_priv *pp = ap->private_data; 376 struct ahci_port_priv *pp = ap->private_data;
386 void *mmio = ap->host_set->mmio_base; 377 void __iomem *mmio = ap->host_set->mmio_base;
387 void *port_mmio = ahci_port_base(mmio, ap->port_no); 378 void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
388 u32 tmp; 379 u32 tmp;
389 380
390 tmp = readl(port_mmio + PORT_CMD); 381 tmp = readl(port_mmio + PORT_CMD);
@@ -546,8 +537,8 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
546 537
547static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) 538static void ahci_intr_error(struct ata_port *ap, u32 irq_stat)
548{ 539{
549 void *mmio = ap->host_set->mmio_base; 540 void __iomem *mmio = ap->host_set->mmio_base;
550 void *port_mmio = ahci_port_base(mmio, ap->port_no); 541 void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
551 u32 tmp; 542 u32 tmp;
552 int work; 543 int work;
553 544
@@ -595,8 +586,8 @@ static void ahci_intr_error(struct ata_port *ap, u32 irq_stat)
595static void ahci_eng_timeout(struct ata_port *ap) 586static void ahci_eng_timeout(struct ata_port *ap)
596{ 587{
597 struct ata_host_set *host_set = ap->host_set; 588 struct ata_host_set *host_set = ap->host_set;
598 void *mmio = host_set->mmio_base; 589 void __iomem *mmio = host_set->mmio_base;
599 void *port_mmio = ahci_port_base(mmio, ap->port_no); 590 void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
600 struct ata_queued_cmd *qc; 591 struct ata_queued_cmd *qc;
601 unsigned long flags; 592 unsigned long flags;
602 593
@@ -626,8 +617,8 @@ static void ahci_eng_timeout(struct ata_port *ap)
626 617
627static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc) 618static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc)
628{ 619{
629 void *mmio = ap->host_set->mmio_base; 620 void __iomem *mmio = ap->host_set->mmio_base;
630 void *port_mmio = ahci_port_base(mmio, ap->port_no); 621 void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
631 u32 status, serr, ci; 622 u32 status, serr, ci;
632 623
633 serr = readl(port_mmio + PORT_SCR_ERR); 624 serr = readl(port_mmio + PORT_SCR_ERR);
@@ -663,7 +654,7 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
663 struct ata_host_set *host_set = dev_instance; 654 struct ata_host_set *host_set = dev_instance;
664 struct ahci_host_priv *hpriv; 655 struct ahci_host_priv *hpriv;
665 unsigned int i, handled = 0; 656 unsigned int i, handled = 0;
666 void *mmio; 657 void __iomem *mmio;
667 u32 irq_stat, irq_ack = 0; 658 u32 irq_stat, irq_ack = 0;
668 659
669 VPRINTK("ENTER\n"); 660 VPRINTK("ENTER\n");
@@ -709,7 +700,7 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
709static int ahci_qc_issue(struct ata_queued_cmd *qc) 700static int ahci_qc_issue(struct ata_queued_cmd *qc)
710{ 701{
711 struct ata_port *ap = qc->ap; 702 struct ata_port *ap = qc->ap;
712 void *port_mmio = (void *) ap->ioaddr.cmd_addr; 703 void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr;
713 704
714 writel(1, port_mmio + PORT_CMD_ISSUE); 705 writel(1, port_mmio + PORT_CMD_ISSUE);
715 readl(port_mmio + PORT_CMD_ISSUE); /* flush */ 706 readl(port_mmio + PORT_CMD_ISSUE); /* flush */
@@ -894,7 +885,7 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent)
894{ 885{
895 struct ahci_host_priv *hpriv = probe_ent->private_data; 886 struct ahci_host_priv *hpriv = probe_ent->private_data;
896 struct pci_dev *pdev = to_pci_dev(probe_ent->dev); 887 struct pci_dev *pdev = to_pci_dev(probe_ent->dev);
897 void *mmio = probe_ent->mmio_base; 888 void __iomem *mmio = probe_ent->mmio_base;
898 u32 vers, cap, impl, speed; 889 u32 vers, cap, impl, speed;
899 const char *speed_s; 890 const char *speed_s;
900 u16 cc; 891 u16 cc;
@@ -967,7 +958,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
967 struct ata_probe_ent *probe_ent = NULL; 958 struct ata_probe_ent *probe_ent = NULL;
968 struct ahci_host_priv *hpriv; 959 struct ahci_host_priv *hpriv;
969 unsigned long base; 960 unsigned long base;
970 void *mmio_base; 961 void __iomem *mmio_base;
971 unsigned int board_idx = (unsigned int) ent->driver_data; 962 unsigned int board_idx = (unsigned int) ent->driver_data;
972 int have_msi, pci_dev_busy = 0; 963 int have_msi, pci_dev_busy = 0;
973 int rc; 964 int rc;
@@ -1004,8 +995,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1004 probe_ent->dev = pci_dev_to_dev(pdev); 995 probe_ent->dev = pci_dev_to_dev(pdev);
1005 INIT_LIST_HEAD(&probe_ent->node); 996 INIT_LIST_HEAD(&probe_ent->node);
1006 997
1007 mmio_base = ioremap(pci_resource_start(pdev, AHCI_PCI_BAR), 998 mmio_base = pci_iomap(pdev, AHCI_PCI_BAR, 0);
1008 pci_resource_len(pdev, AHCI_PCI_BAR));
1009 if (mmio_base == NULL) { 999 if (mmio_base == NULL) {
1010 rc = -ENOMEM; 1000 rc = -ENOMEM;
1011 goto err_out_free_ent; 1001 goto err_out_free_ent;
@@ -1049,7 +1039,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1049err_out_hpriv: 1039err_out_hpriv:
1050 kfree(hpriv); 1040 kfree(hpriv);
1051err_out_iounmap: 1041err_out_iounmap:
1052 iounmap(mmio_base); 1042 pci_iounmap(pdev, mmio_base);
1053err_out_free_ent: 1043err_out_free_ent:
1054 kfree(probe_ent); 1044 kfree(probe_ent);
1055err_out_msi: 1045err_out_msi:
@@ -1089,7 +1079,8 @@ static void ahci_remove_one (struct pci_dev *pdev)
1089 scsi_host_put(ap->host); 1079 scsi_host_put(ap->host);
1090 } 1080 }
1091 1081
1092 host_set->ops->host_stop(host_set); 1082 kfree(hpriv);
1083 pci_iounmap(pdev, host_set->mmio_base);
1093 kfree(host_set); 1084 kfree(host_set);
1094 1085
1095 if (have_msi) 1086 if (have_msi)
@@ -1106,7 +1097,6 @@ static int __init ahci_init(void)
1106 return pci_module_init(&ahci_pci_driver); 1097 return pci_module_init(&ahci_pci_driver);
1107} 1098}
1108 1099
1109
1110static void __exit ahci_exit(void) 1100static void __exit ahci_exit(void)
1111{ 1101{
1112 pci_unregister_driver(&ahci_pci_driver); 1102 pci_unregister_driver(&ahci_pci_driver);
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index fb28c1261848..deec0cef88d9 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -583,8 +583,7 @@ static void pci_enable_intx(struct pci_dev *pdev)
583#define AHCI_ENABLE (1 << 31) 583#define AHCI_ENABLE (1 << 31)
584static int piix_disable_ahci(struct pci_dev *pdev) 584static int piix_disable_ahci(struct pci_dev *pdev)
585{ 585{
586 void *mmio; 586 void __iomem *mmio;
587 unsigned long addr;
588 u32 tmp; 587 u32 tmp;
589 int rc = 0; 588 int rc = 0;
590 589
@@ -592,11 +591,11 @@ static int piix_disable_ahci(struct pci_dev *pdev)
592 * works because this device is usually set up by BIOS. 591 * works because this device is usually set up by BIOS.
593 */ 592 */
594 593
595 addr = pci_resource_start(pdev, AHCI_PCI_BAR); 594 if (!pci_resource_start(pdev, AHCI_PCI_BAR) ||
596 if (!addr || !pci_resource_len(pdev, AHCI_PCI_BAR)) 595 !pci_resource_len(pdev, AHCI_PCI_BAR))
597 return 0; 596 return 0;
598 597
599 mmio = ioremap(addr, 64); 598 mmio = pci_iomap(pdev, AHCI_PCI_BAR, 64);
600 if (!mmio) 599 if (!mmio)
601 return -ENOMEM; 600 return -ENOMEM;
602 601
@@ -610,7 +609,7 @@ static int piix_disable_ahci(struct pci_dev *pdev)
610 rc = -EIO; 609 rc = -EIO;
611 } 610 }
612 611
613 iounmap(mmio); 612 pci_iounmap(pdev, mmio);
614 return rc; 613 return rc;
615} 614}
616 615
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index dee4b12b0342..9fb9814525a3 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -75,6 +75,10 @@ static void __ata_qc_complete(struct ata_queued_cmd *qc);
75static unsigned int ata_unique_id = 1; 75static unsigned int ata_unique_id = 1;
76static struct workqueue_struct *ata_wq; 76static struct workqueue_struct *ata_wq;
77 77
78int atapi_enabled = 0;
79module_param(atapi_enabled, int, 0444);
80MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)");
81
78MODULE_AUTHOR("Jeff Garzik"); 82MODULE_AUTHOR("Jeff Garzik");
79MODULE_DESCRIPTION("Library module for ATA devices"); 83MODULE_DESCRIPTION("Library module for ATA devices");
80MODULE_LICENSE("GPL"); 84MODULE_LICENSE("GPL");
@@ -4200,6 +4204,15 @@ ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)
4200 4204
4201 4205
4202 4206
4207#ifdef CONFIG_PCI
4208
4209void ata_pci_host_stop (struct ata_host_set *host_set)
4210{
4211 struct pci_dev *pdev = to_pci_dev(host_set->dev);
4212
4213 pci_iounmap(pdev, host_set->mmio_base);
4214}
4215
4203/** 4216/**
4204 * ata_pci_init_native_mode - Initialize native-mode driver 4217 * ata_pci_init_native_mode - Initialize native-mode driver
4205 * @pdev: pci device to be initialized 4218 * @pdev: pci device to be initialized
@@ -4212,7 +4225,6 @@ ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)
4212 * ata_probe_ent structure should then be freed with kfree(). 4225 * ata_probe_ent structure should then be freed with kfree().
4213 */ 4226 */
4214 4227
4215#ifdef CONFIG_PCI
4216struct ata_probe_ent * 4228struct ata_probe_ent *
4217ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port) 4229ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
4218{ 4230{
@@ -4595,6 +4607,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_simulate);
4595 4607
4596#ifdef CONFIG_PCI 4608#ifdef CONFIG_PCI
4597EXPORT_SYMBOL_GPL(pci_test_config_bits); 4609EXPORT_SYMBOL_GPL(pci_test_config_bits);
4610EXPORT_SYMBOL_GPL(ata_pci_host_stop);
4598EXPORT_SYMBOL_GPL(ata_pci_init_native_mode); 4611EXPORT_SYMBOL_GPL(ata_pci_init_native_mode);
4599EXPORT_SYMBOL_GPL(ata_pci_init_one); 4612EXPORT_SYMBOL_GPL(ata_pci_init_one);
4600EXPORT_SYMBOL_GPL(ata_pci_remove_one); 4613EXPORT_SYMBOL_GPL(ata_pci_remove_one);
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 346eb36b1e31..104fd9a63e73 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -1470,10 +1470,10 @@ ata_scsi_find_dev(struct ata_port *ap, struct scsi_device *scsidev)
1470 if (unlikely(!ata_dev_present(dev))) 1470 if (unlikely(!ata_dev_present(dev)))
1471 return NULL; 1471 return NULL;
1472 1472
1473#ifndef ATA_ENABLE_ATAPI 1473 if (!atapi_enabled) {
1474 if (unlikely(dev->class == ATA_DEV_ATAPI)) 1474 if (unlikely(dev->class == ATA_DEV_ATAPI))
1475 return NULL; 1475 return NULL;
1476#endif 1476 }
1477 1477
1478 return dev; 1478 return dev;
1479} 1479}
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index 809c634afbcd..d608b3a0f6fe 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -38,6 +38,7 @@ struct ata_scsi_args {
38}; 38};
39 39
40/* libata-core.c */ 40/* libata-core.c */
41extern int atapi_enabled;
41extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, 42extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
42 struct ata_device *dev); 43 struct ata_device *dev);
43extern void ata_qc_free(struct ata_queued_cmd *qc); 44extern void ata_qc_free(struct ata_queued_cmd *qc);
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index 03d9bc6e69df..a1d62dee3be6 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -351,6 +351,7 @@ static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
351static void nv_host_stop (struct ata_host_set *host_set) 351static void nv_host_stop (struct ata_host_set *host_set)
352{ 352{
353 struct nv_host *host = host_set->private_data; 353 struct nv_host *host = host_set->private_data;
354 struct pci_dev *pdev = to_pci_dev(host_set->dev);
354 355
355 // Disable hotplug event interrupts. 356 // Disable hotplug event interrupts.
356 if (host->host_desc->disable_hotplug) 357 if (host->host_desc->disable_hotplug)
@@ -358,7 +359,8 @@ static void nv_host_stop (struct ata_host_set *host_set)
358 359
359 kfree(host); 360 kfree(host);
360 361
361 ata_host_stop(host_set); 362 if (host_set->mmio_base)
363 pci_iounmap(pdev, host_set->mmio_base);
362} 364}
363 365
364static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) 366static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -420,8 +422,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
420 if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) { 422 if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) {
421 unsigned long base; 423 unsigned long base;
422 424
423 probe_ent->mmio_base = ioremap(pci_resource_start(pdev, 5), 425 probe_ent->mmio_base = pci_iomap(pdev, 5, 0);
424 pci_resource_len(pdev, 5));
425 if (probe_ent->mmio_base == NULL) { 426 if (probe_ent->mmio_base == NULL) {
426 rc = -EIO; 427 rc = -EIO;
427 goto err_out_free_host; 428 goto err_out_free_host;
@@ -457,7 +458,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
457 458
458err_out_iounmap: 459err_out_iounmap:
459 if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) 460 if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO)
460 iounmap(probe_ent->mmio_base); 461 pci_iounmap(pdev, probe_ent->mmio_base);
461err_out_free_host: 462err_out_free_host:
462 kfree(host); 463 kfree(host);
463err_out_free_ent: 464err_out_free_ent:
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index 7c4f6ecc1cc9..538ad727bd2e 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -92,6 +92,7 @@ static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
92static void pdc_irq_clear(struct ata_port *ap); 92static void pdc_irq_clear(struct ata_port *ap);
93static int pdc_qc_issue_prot(struct ata_queued_cmd *qc); 93static int pdc_qc_issue_prot(struct ata_queued_cmd *qc);
94 94
95
95static Scsi_Host_Template pdc_ata_sht = { 96static Scsi_Host_Template pdc_ata_sht = {
96 .module = THIS_MODULE, 97 .module = THIS_MODULE,
97 .name = DRV_NAME, 98 .name = DRV_NAME,
@@ -132,7 +133,7 @@ static struct ata_port_operations pdc_sata_ops = {
132 .scr_write = pdc_sata_scr_write, 133 .scr_write = pdc_sata_scr_write,
133 .port_start = pdc_port_start, 134 .port_start = pdc_port_start,
134 .port_stop = pdc_port_stop, 135 .port_stop = pdc_port_stop,
135 .host_stop = ata_host_stop, 136 .host_stop = ata_pci_host_stop,
136}; 137};
137 138
138static struct ata_port_operations pdc_pata_ops = { 139static struct ata_port_operations pdc_pata_ops = {
@@ -153,7 +154,7 @@ static struct ata_port_operations pdc_pata_ops = {
153 154
154 .port_start = pdc_port_start, 155 .port_start = pdc_port_start,
155 .port_stop = pdc_port_stop, 156 .port_stop = pdc_port_stop,
156 .host_stop = ata_host_stop, 157 .host_stop = ata_pci_host_stop,
157}; 158};
158 159
159static struct ata_port_info pdc_port_info[] = { 160static struct ata_port_info pdc_port_info[] = {
@@ -282,7 +283,7 @@ static void pdc_port_stop(struct ata_port *ap)
282 283
283static void pdc_reset_port(struct ata_port *ap) 284static void pdc_reset_port(struct ata_port *ap)
284{ 285{
285 void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT; 286 void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT;
286 unsigned int i; 287 unsigned int i;
287 u32 tmp; 288 u32 tmp;
288 289
@@ -418,7 +419,7 @@ static inline unsigned int pdc_host_intr( struct ata_port *ap,
418 u8 status; 419 u8 status;
419 unsigned int handled = 0, have_err = 0; 420 unsigned int handled = 0, have_err = 0;
420 u32 tmp; 421 u32 tmp;
421 void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_GLOBAL_CTL; 422 void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_GLOBAL_CTL;
422 423
423 tmp = readl(mmio); 424 tmp = readl(mmio);
424 if (tmp & PDC_ERR_MASK) { 425 if (tmp & PDC_ERR_MASK) {
@@ -447,7 +448,7 @@ static inline unsigned int pdc_host_intr( struct ata_port *ap,
447static void pdc_irq_clear(struct ata_port *ap) 448static void pdc_irq_clear(struct ata_port *ap)
448{ 449{
449 struct ata_host_set *host_set = ap->host_set; 450 struct ata_host_set *host_set = ap->host_set;
450 void *mmio = host_set->mmio_base; 451 void __iomem *mmio = host_set->mmio_base;
451 452
452 readl(mmio + PDC_INT_SEQMASK); 453 readl(mmio + PDC_INT_SEQMASK);
453} 454}
@@ -459,7 +460,7 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *r
459 u32 mask = 0; 460 u32 mask = 0;
460 unsigned int i, tmp; 461 unsigned int i, tmp;
461 unsigned int handled = 0; 462 unsigned int handled = 0;
462 void *mmio_base; 463 void __iomem *mmio_base;
463 464
464 VPRINTK("ENTER\n"); 465 VPRINTK("ENTER\n");
465 466
@@ -581,7 +582,7 @@ static void pdc_ata_setup_port(struct ata_ioports *port, unsigned long base)
581 582
582static void pdc_host_init(unsigned int chip_id, struct ata_probe_ent *pe) 583static void pdc_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
583{ 584{
584 void *mmio = pe->mmio_base; 585 void __iomem *mmio = pe->mmio_base;
585 u32 tmp; 586 u32 tmp;
586 587
587 /* 588 /*
@@ -624,7 +625,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
624 static int printed_version; 625 static int printed_version;
625 struct ata_probe_ent *probe_ent = NULL; 626 struct ata_probe_ent *probe_ent = NULL;
626 unsigned long base; 627 unsigned long base;
627 void *mmio_base; 628 void __iomem *mmio_base;
628 unsigned int board_idx = (unsigned int) ent->driver_data; 629 unsigned int board_idx = (unsigned int) ent->driver_data;
629 int pci_dev_busy = 0; 630 int pci_dev_busy = 0;
630 int rc; 631 int rc;
@@ -663,8 +664,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
663 probe_ent->dev = pci_dev_to_dev(pdev); 664 probe_ent->dev = pci_dev_to_dev(pdev);
664 INIT_LIST_HEAD(&probe_ent->node); 665 INIT_LIST_HEAD(&probe_ent->node);
665 666
666 mmio_base = ioremap(pci_resource_start(pdev, 3), 667 mmio_base = pci_iomap(pdev, 3, 0);
667 pci_resource_len(pdev, 3));
668 if (mmio_base == NULL) { 668 if (mmio_base == NULL) {
669 rc = -ENOMEM; 669 rc = -ENOMEM;
670 goto err_out_free_ent; 670 goto err_out_free_ent;
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index 9c99ab433bd3..029c2482e127 100644
--- a/drivers/scsi/sata_qstor.c
+++ b/drivers/scsi/sata_qstor.c
@@ -538,11 +538,12 @@ static void qs_port_stop(struct ata_port *ap)
538static void qs_host_stop(struct ata_host_set *host_set) 538static void qs_host_stop(struct ata_host_set *host_set)
539{ 539{
540 void __iomem *mmio_base = host_set->mmio_base; 540 void __iomem *mmio_base = host_set->mmio_base;
541 struct pci_dev *pdev = to_pci_dev(host_set->dev);
541 542
542 writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */ 543 writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
543 writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */ 544 writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */
544 545
545 ata_host_stop(host_set); 546 pci_iounmap(pdev, mmio_base);
546} 547}
547 548
548static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe) 549static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
@@ -646,8 +647,7 @@ static int qs_ata_init_one(struct pci_dev *pdev,
646 goto err_out_regions; 647 goto err_out_regions;
647 } 648 }
648 649
649 mmio_base = ioremap(pci_resource_start(pdev, 4), 650 mmio_base = pci_iomap(pdev, 4, 0);
650 pci_resource_len(pdev, 4));
651 if (mmio_base == NULL) { 651 if (mmio_base == NULL) {
652 rc = -ENOMEM; 652 rc = -ENOMEM;
653 goto err_out_regions; 653 goto err_out_regions;
@@ -697,7 +697,7 @@ static int qs_ata_init_one(struct pci_dev *pdev,
697 return 0; 697 return 0;
698 698
699err_out_iounmap: 699err_out_iounmap:
700 iounmap(mmio_base); 700 pci_iounmap(pdev, mmio_base);
701err_out_regions: 701err_out_regions:
702 pci_release_regions(pdev); 702 pci_release_regions(pdev);
703err_out: 703err_out:
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 71d49548f0a3..ba98a175ee3a 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -86,6 +86,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg);
86static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 86static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
87static void sil_post_set_mode (struct ata_port *ap); 87static void sil_post_set_mode (struct ata_port *ap);
88 88
89
89static struct pci_device_id sil_pci_tbl[] = { 90static struct pci_device_id sil_pci_tbl[] = {
90 { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, 91 { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
91 { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, 92 { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
@@ -172,7 +173,7 @@ static struct ata_port_operations sil_ops = {
172 .scr_write = sil_scr_write, 173 .scr_write = sil_scr_write,
173 .port_start = ata_port_start, 174 .port_start = ata_port_start,
174 .port_stop = ata_port_stop, 175 .port_stop = ata_port_stop,
175 .host_stop = ata_host_stop, 176 .host_stop = ata_pci_host_stop,
176}; 177};
177 178
178static struct ata_port_info sil_port_info[] = { 179static struct ata_port_info sil_port_info[] = {
@@ -231,6 +232,7 @@ MODULE_LICENSE("GPL");
231MODULE_DEVICE_TABLE(pci, sil_pci_tbl); 232MODULE_DEVICE_TABLE(pci, sil_pci_tbl);
232MODULE_VERSION(DRV_VERSION); 233MODULE_VERSION(DRV_VERSION);
233 234
235
234static unsigned char sil_get_device_cache_line(struct pci_dev *pdev) 236static unsigned char sil_get_device_cache_line(struct pci_dev *pdev)
235{ 237{
236 u8 cache_line = 0; 238 u8 cache_line = 0;
@@ -242,7 +244,8 @@ static void sil_post_set_mode (struct ata_port *ap)
242{ 244{
243 struct ata_host_set *host_set = ap->host_set; 245 struct ata_host_set *host_set = ap->host_set;
244 struct ata_device *dev; 246 struct ata_device *dev;
245 void *addr = host_set->mmio_base + sil_port[ap->port_no].xfer_mode; 247 void __iomem *addr =
248 host_set->mmio_base + sil_port[ap->port_no].xfer_mode;
246 u32 tmp, dev_mode[2]; 249 u32 tmp, dev_mode[2];
247 unsigned int i; 250 unsigned int i;
248 251
@@ -375,7 +378,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
375 static int printed_version; 378 static int printed_version;
376 struct ata_probe_ent *probe_ent = NULL; 379 struct ata_probe_ent *probe_ent = NULL;
377 unsigned long base; 380 unsigned long base;
378 void *mmio_base; 381 void __iomem *mmio_base;
379 int rc; 382 int rc;
380 unsigned int i; 383 unsigned int i;
381 int pci_dev_busy = 0; 384 int pci_dev_busy = 0;
@@ -425,8 +428,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
425 probe_ent->irq_flags = SA_SHIRQ; 428 probe_ent->irq_flags = SA_SHIRQ;
426 probe_ent->host_flags = sil_port_info[ent->driver_data].host_flags; 429 probe_ent->host_flags = sil_port_info[ent->driver_data].host_flags;
427 430
428 mmio_base = ioremap(pci_resource_start(pdev, 5), 431 mmio_base = pci_iomap(pdev, 5, 0);
429 pci_resource_len(pdev, 5));
430 if (mmio_base == NULL) { 432 if (mmio_base == NULL) {
431 rc = -ENOMEM; 433 rc = -ENOMEM;
432 goto err_out_free_ent; 434 goto err_out_free_ent;
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 19d3bb3b0fb6..d89d968bedac 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -318,7 +318,7 @@ static struct ata_port_operations k2_sata_ops = {
318 .scr_write = k2_sata_scr_write, 318 .scr_write = k2_sata_scr_write,
319 .port_start = ata_port_start, 319 .port_start = ata_port_start,
320 .port_stop = ata_port_stop, 320 .port_stop = ata_port_stop,
321 .host_stop = ata_host_stop, 321 .host_stop = ata_pci_host_stop,
322}; 322};
323 323
324static void k2_sata_setup_port(struct ata_ioports *port, unsigned long base) 324static void k2_sata_setup_port(struct ata_ioports *port, unsigned long base)
@@ -346,7 +346,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
346 static int printed_version; 346 static int printed_version;
347 struct ata_probe_ent *probe_ent = NULL; 347 struct ata_probe_ent *probe_ent = NULL;
348 unsigned long base; 348 unsigned long base;
349 void *mmio_base; 349 void __iomem *mmio_base;
350 int pci_dev_busy = 0; 350 int pci_dev_busy = 0;
351 int rc; 351 int rc;
352 int i; 352 int i;
@@ -392,8 +392,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
392 probe_ent->dev = pci_dev_to_dev(pdev); 392 probe_ent->dev = pci_dev_to_dev(pdev);
393 INIT_LIST_HEAD(&probe_ent->node); 393 INIT_LIST_HEAD(&probe_ent->node);
394 394
395 mmio_base = ioremap(pci_resource_start(pdev, 5), 395 mmio_base = pci_iomap(pdev, 5, 0);
396 pci_resource_len(pdev, 5));
397 if (mmio_base == NULL) { 396 if (mmio_base == NULL) {
398 rc = -ENOMEM; 397 rc = -ENOMEM;
399 goto err_out_free_ent; 398 goto err_out_free_ent;
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index c72fcc46f0fa..540a85191172 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -245,13 +245,14 @@ static struct pci_driver pdc_sata_pci_driver = {
245 245
246static void pdc20621_host_stop(struct ata_host_set *host_set) 246static void pdc20621_host_stop(struct ata_host_set *host_set)
247{ 247{
248 struct pci_dev *pdev = to_pci_dev(host_set->dev);
248 struct pdc_host_priv *hpriv = host_set->private_data; 249 struct pdc_host_priv *hpriv = host_set->private_data;
249 void *dimm_mmio = hpriv->dimm_mmio; 250 void *dimm_mmio = hpriv->dimm_mmio;
250 251
251 iounmap(dimm_mmio); 252 pci_iounmap(pdev, dimm_mmio);
252 kfree(hpriv); 253 kfree(hpriv);
253 254
254 ata_host_stop(host_set); 255 pci_iounmap(pdev, host_set->mmio_base);
255} 256}
256 257
257static int pdc_port_start(struct ata_port *ap) 258static int pdc_port_start(struct ata_port *ap)
@@ -451,9 +452,9 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc)
451 struct scatterlist *sg = qc->sg; 452 struct scatterlist *sg = qc->sg;
452 struct ata_port *ap = qc->ap; 453 struct ata_port *ap = qc->ap;
453 struct pdc_port_priv *pp = ap->private_data; 454 struct pdc_port_priv *pp = ap->private_data;
454 void *mmio = ap->host_set->mmio_base; 455 void __iomem *mmio = ap->host_set->mmio_base;
455 struct pdc_host_priv *hpriv = ap->host_set->private_data; 456 struct pdc_host_priv *hpriv = ap->host_set->private_data;
456 void *dimm_mmio = hpriv->dimm_mmio; 457 void __iomem *dimm_mmio = hpriv->dimm_mmio;
457 unsigned int portno = ap->port_no; 458 unsigned int portno = ap->port_no;
458 unsigned int i, last, idx, total_len = 0, sgt_len; 459 unsigned int i, last, idx, total_len = 0, sgt_len;
459 u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; 460 u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ];
@@ -513,9 +514,9 @@ static void pdc20621_nodata_prep(struct ata_queued_cmd *qc)
513{ 514{
514 struct ata_port *ap = qc->ap; 515 struct ata_port *ap = qc->ap;
515 struct pdc_port_priv *pp = ap->private_data; 516 struct pdc_port_priv *pp = ap->private_data;
516 void *mmio = ap->host_set->mmio_base; 517 void __iomem *mmio = ap->host_set->mmio_base;
517 struct pdc_host_priv *hpriv = ap->host_set->private_data; 518 struct pdc_host_priv *hpriv = ap->host_set->private_data;
518 void *dimm_mmio = hpriv->dimm_mmio; 519 void __iomem *dimm_mmio = hpriv->dimm_mmio;
519 unsigned int portno = ap->port_no; 520 unsigned int portno = ap->port_no;
520 unsigned int i; 521 unsigned int i;
521 522
@@ -565,7 +566,7 @@ static void __pdc20621_push_hdma(struct ata_queued_cmd *qc,
565{ 566{
566 struct ata_port *ap = qc->ap; 567 struct ata_port *ap = qc->ap;
567 struct ata_host_set *host_set = ap->host_set; 568 struct ata_host_set *host_set = ap->host_set;
568 void *mmio = host_set->mmio_base; 569 void __iomem *mmio = host_set->mmio_base;
569 570
570 /* hard-code chip #0 */ 571 /* hard-code chip #0 */
571 mmio += PDC_CHIP0_OFS; 572 mmio += PDC_CHIP0_OFS;
@@ -639,7 +640,7 @@ static void pdc20621_packet_start(struct ata_queued_cmd *qc)
639 struct ata_port *ap = qc->ap; 640 struct ata_port *ap = qc->ap;
640 struct ata_host_set *host_set = ap->host_set; 641 struct ata_host_set *host_set = ap->host_set;
641 unsigned int port_no = ap->port_no; 642 unsigned int port_no = ap->port_no;
642 void *mmio = host_set->mmio_base; 643 void __iomem *mmio = host_set->mmio_base;
643 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); 644 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
644 u8 seq = (u8) (port_no + 1); 645 u8 seq = (u8) (port_no + 1);
645 unsigned int port_ofs; 646 unsigned int port_ofs;
@@ -699,7 +700,7 @@ static int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc)
699static inline unsigned int pdc20621_host_intr( struct ata_port *ap, 700static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
700 struct ata_queued_cmd *qc, 701 struct ata_queued_cmd *qc,
701 unsigned int doing_hdma, 702 unsigned int doing_hdma,
702 void *mmio) 703 void __iomem *mmio)
703{ 704{
704 unsigned int port_no = ap->port_no; 705 unsigned int port_no = ap->port_no;
705 unsigned int port_ofs = 706 unsigned int port_ofs =
@@ -778,7 +779,7 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
778static void pdc20621_irq_clear(struct ata_port *ap) 779static void pdc20621_irq_clear(struct ata_port *ap)
779{ 780{
780 struct ata_host_set *host_set = ap->host_set; 781 struct ata_host_set *host_set = ap->host_set;
781 void *mmio = host_set->mmio_base; 782 void __iomem *mmio = host_set->mmio_base;
782 783
783 mmio += PDC_CHIP0_OFS; 784 mmio += PDC_CHIP0_OFS;
784 785
@@ -792,7 +793,7 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_re
792 u32 mask = 0; 793 u32 mask = 0;
793 unsigned int i, tmp, port_no; 794 unsigned int i, tmp, port_no;
794 unsigned int handled = 0; 795 unsigned int handled = 0;
795 void *mmio_base; 796 void __iomem *mmio_base;
796 797
797 VPRINTK("ENTER\n"); 798 VPRINTK("ENTER\n");
798 799
@@ -940,9 +941,9 @@ static void pdc20621_get_from_dimm(struct ata_probe_ent *pe, void *psource,
940 u16 idx; 941 u16 idx;
941 u8 page_mask; 942 u8 page_mask;
942 long dist; 943 long dist;
943 void *mmio = pe->mmio_base; 944 void __iomem *mmio = pe->mmio_base;
944 struct pdc_host_priv *hpriv = pe->private_data; 945 struct pdc_host_priv *hpriv = pe->private_data;
945 void *dimm_mmio = hpriv->dimm_mmio; 946 void __iomem *dimm_mmio = hpriv->dimm_mmio;
946 947
947 /* hard-code chip #0 */ 948 /* hard-code chip #0 */
948 mmio += PDC_CHIP0_OFS; 949 mmio += PDC_CHIP0_OFS;
@@ -996,9 +997,9 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource,
996 u16 idx; 997 u16 idx;
997 u8 page_mask; 998 u8 page_mask;
998 long dist; 999 long dist;
999 void *mmio = pe->mmio_base; 1000 void __iomem *mmio = pe->mmio_base;
1000 struct pdc_host_priv *hpriv = pe->private_data; 1001 struct pdc_host_priv *hpriv = pe->private_data;
1001 void *dimm_mmio = hpriv->dimm_mmio; 1002 void __iomem *dimm_mmio = hpriv->dimm_mmio;
1002 1003
1003 /* hard-code chip #0 */ 1004 /* hard-code chip #0 */
1004 mmio += PDC_CHIP0_OFS; 1005 mmio += PDC_CHIP0_OFS;
@@ -1044,7 +1045,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource,
1044static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, u32 device, 1045static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, u32 device,
1045 u32 subaddr, u32 *pdata) 1046 u32 subaddr, u32 *pdata)
1046{ 1047{
1047 void *mmio = pe->mmio_base; 1048 void __iomem *mmio = pe->mmio_base;
1048 u32 i2creg = 0; 1049 u32 i2creg = 0;
1049 u32 status; 1050 u32 status;
1050 u32 count =0; 1051 u32 count =0;
@@ -1103,7 +1104,7 @@ static int pdc20621_prog_dimm0(struct ata_probe_ent *pe)
1103 u32 data = 0; 1104 u32 data = 0;
1104 int size, i; 1105 int size, i;
1105 u8 bdimmsize; 1106 u8 bdimmsize;
1106 void *mmio = pe->mmio_base; 1107 void __iomem *mmio = pe->mmio_base;
1107 static const struct { 1108 static const struct {
1108 unsigned int reg; 1109 unsigned int reg;
1109 unsigned int ofs; 1110 unsigned int ofs;
@@ -1166,7 +1167,7 @@ static unsigned int pdc20621_prog_dimm_global(struct ata_probe_ent *pe)
1166{ 1167{
1167 u32 data, spd0; 1168 u32 data, spd0;
1168 int error, i; 1169 int error, i;
1169 void *mmio = pe->mmio_base; 1170 void __iomem *mmio = pe->mmio_base;
1170 1171
1171 /* hard-code chip #0 */ 1172 /* hard-code chip #0 */
1172 mmio += PDC_CHIP0_OFS; 1173 mmio += PDC_CHIP0_OFS;
@@ -1220,7 +1221,7 @@ static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe)
1220 u32 ticks=0; 1221 u32 ticks=0;
1221 u32 clock=0; 1222 u32 clock=0;
1222 u32 fparam=0; 1223 u32 fparam=0;
1223 void *mmio = pe->mmio_base; 1224 void __iomem *mmio = pe->mmio_base;
1224 1225
1225 /* hard-code chip #0 */ 1226 /* hard-code chip #0 */
1226 mmio += PDC_CHIP0_OFS; 1227 mmio += PDC_CHIP0_OFS;
@@ -1344,7 +1345,7 @@ static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe)
1344static void pdc_20621_init(struct ata_probe_ent *pe) 1345static void pdc_20621_init(struct ata_probe_ent *pe)
1345{ 1346{
1346 u32 tmp; 1347 u32 tmp;
1347 void *mmio = pe->mmio_base; 1348 void __iomem *mmio = pe->mmio_base;
1348 1349
1349 /* hard-code chip #0 */ 1350 /* hard-code chip #0 */
1350 mmio += PDC_CHIP0_OFS; 1351 mmio += PDC_CHIP0_OFS;
@@ -1377,7 +1378,8 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
1377 static int printed_version; 1378 static int printed_version;
1378 struct ata_probe_ent *probe_ent = NULL; 1379 struct ata_probe_ent *probe_ent = NULL;
1379 unsigned long base; 1380 unsigned long base;
1380 void *mmio_base, *dimm_mmio = NULL; 1381 void __iomem *mmio_base;
1382 void __iomem *dimm_mmio = NULL;
1381 struct pdc_host_priv *hpriv = NULL; 1383 struct pdc_host_priv *hpriv = NULL;
1382 unsigned int board_idx = (unsigned int) ent->driver_data; 1384 unsigned int board_idx = (unsigned int) ent->driver_data;
1383 int pci_dev_busy = 0; 1385 int pci_dev_busy = 0;
@@ -1417,8 +1419,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
1417 probe_ent->dev = pci_dev_to_dev(pdev); 1419 probe_ent->dev = pci_dev_to_dev(pdev);
1418 INIT_LIST_HEAD(&probe_ent->node); 1420 INIT_LIST_HEAD(&probe_ent->node);
1419 1421
1420 mmio_base = ioremap(pci_resource_start(pdev, 3), 1422 mmio_base = pci_iomap(pdev, 3, 0);
1421 pci_resource_len(pdev, 3));
1422 if (mmio_base == NULL) { 1423 if (mmio_base == NULL) {
1423 rc = -ENOMEM; 1424 rc = -ENOMEM;
1424 goto err_out_free_ent; 1425 goto err_out_free_ent;
@@ -1432,8 +1433,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
1432 } 1433 }
1433 memset(hpriv, 0, sizeof(*hpriv)); 1434 memset(hpriv, 0, sizeof(*hpriv));
1434 1435
1435 dimm_mmio = ioremap(pci_resource_start(pdev, 4), 1436 dimm_mmio = pci_iomap(pdev, 4, 0);
1436 pci_resource_len(pdev, 4));
1437 if (!dimm_mmio) { 1437 if (!dimm_mmio) {
1438 kfree(hpriv); 1438 kfree(hpriv);
1439 rc = -ENOMEM; 1439 rc = -ENOMEM;
@@ -1480,9 +1480,9 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
1480 1480
1481err_out_iounmap_dimm: /* only get to this label if 20621 */ 1481err_out_iounmap_dimm: /* only get to this label if 20621 */
1482 kfree(hpriv); 1482 kfree(hpriv);
1483 iounmap(dimm_mmio); 1483 pci_iounmap(pdev, dimm_mmio);
1484err_out_iounmap: 1484err_out_iounmap:
1485 iounmap(mmio_base); 1485 pci_iounmap(pdev, mmio_base);
1486err_out_free_ent: 1486err_out_free_ent:
1487 kfree(probe_ent); 1487 kfree(probe_ent);
1488err_out_regions: 1488err_out_regions:
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index 3985f344da4d..cf94e0158a8d 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -252,7 +252,7 @@ static struct ata_port_operations vsc_sata_ops = {
252 .scr_write = vsc_sata_scr_write, 252 .scr_write = vsc_sata_scr_write,
253 .port_start = ata_port_start, 253 .port_start = ata_port_start,
254 .port_stop = ata_port_stop, 254 .port_stop = ata_port_stop,
255 .host_stop = ata_host_stop, 255 .host_stop = ata_pci_host_stop,
256}; 256};
257 257
258static void __devinit vsc_sata_setup_port(struct ata_ioports *port, unsigned long base) 258static void __devinit vsc_sata_setup_port(struct ata_ioports *port, unsigned long base)
@@ -326,8 +326,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
326 probe_ent->dev = pci_dev_to_dev(pdev); 326 probe_ent->dev = pci_dev_to_dev(pdev);
327 INIT_LIST_HEAD(&probe_ent->node); 327 INIT_LIST_HEAD(&probe_ent->node);
328 328
329 mmio_base = ioremap(pci_resource_start(pdev, 0), 329 mmio_base = pci_iomap(pdev, 0, 0);
330 pci_resource_len(pdev, 0));
331 if (mmio_base == NULL) { 330 if (mmio_base == NULL) {
332 rc = -ENOMEM; 331 rc = -ENOMEM;
333 goto err_out_free_ent; 332 goto err_out_free_ent;