aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it8213.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/it8213.c')
-rw-r--r--drivers/ide/pci/it8213.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index 2b71bdf74e73..6eba8f188264 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -14,6 +14,8 @@
14#include <linux/ide.h> 14#include <linux/ide.h>
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#define DRV_NAME "it8213"
18
17/** 19/**
18 * it8213_set_pio_mode - set host controller for PIO mode 20 * it8213_set_pio_mode - set host controller for PIO mode
19 * @drive: drive 21 * @drive: drive
@@ -155,23 +157,17 @@ static const struct ide_port_ops it8213_port_ops = {
155 .cable_detect = it8213_cable_detect, 157 .cable_detect = it8213_cable_detect,
156}; 158};
157 159
158#define DECLARE_ITE_DEV(name_str) \ 160static const struct ide_port_info it8213_chipset __devinitdata = {
159 { \ 161 .name = DRV_NAME,
160 .name = name_str, \ 162 .enablebits = { {0x41, 0x80, 0x80} },
161 .enablebits = { {0x41, 0x80, 0x80} }, \ 163 .port_ops = &it8213_port_ops,
162 .port_ops = &it8213_port_ops, \ 164 .host_flags = IDE_HFLAG_SINGLE,
163 .host_flags = IDE_HFLAG_SINGLE, \ 165 .pio_mask = ATA_PIO4,
164 .pio_mask = ATA_PIO4, \ 166 .swdma_mask = ATA_SWDMA2_ONLY,
165 .swdma_mask = ATA_SWDMA2_ONLY, \ 167 .mwdma_mask = ATA_MWDMA12_ONLY,
166 .mwdma_mask = ATA_MWDMA12_ONLY, \ 168 .udma_mask = ATA_UDMA6,
167 .udma_mask = ATA_UDMA6, \
168 }
169
170static const struct ide_port_info it8213_chipsets[] __devinitdata = {
171 /* 0 */ DECLARE_ITE_DEV("IT8213"),
172}; 169};
173 170
174
175/** 171/**
176 * it8213_init_one - pci layer discovery entry 172 * it8213_init_one - pci layer discovery entry
177 * @dev: PCI device 173 * @dev: PCI device
@@ -184,7 +180,7 @@ static const struct ide_port_info it8213_chipsets[] __devinitdata = {
184 180
185static int __devinit it8213_init_one(struct pci_dev *dev, const struct pci_device_id *id) 181static int __devinit it8213_init_one(struct pci_dev *dev, const struct pci_device_id *id)
186{ 182{
187 return ide_setup_pci_device(dev, &it8213_chipsets[id->driver_data]); 183 return ide_pci_init_one(dev, &it8213_chipset, NULL);
188} 184}
189 185
190static const struct pci_device_id it8213_pci_tbl[] = { 186static const struct pci_device_id it8213_pci_tbl[] = {
@@ -198,6 +194,7 @@ static struct pci_driver driver = {
198 .name = "ITE8213_IDE", 194 .name = "ITE8213_IDE",
199 .id_table = it8213_pci_tbl, 195 .id_table = it8213_pci_tbl,
200 .probe = it8213_init_one, 196 .probe = it8213_init_one,
197 .remove = ide_pci_remove,
201}; 198};
202 199
203static int __init it8213_ide_init(void) 200static int __init it8213_ide_init(void)
@@ -205,7 +202,13 @@ static int __init it8213_ide_init(void)
205 return ide_pci_register_driver(&driver); 202 return ide_pci_register_driver(&driver);
206} 203}
207 204
205static void __exit it8213_ide_exit(void)
206{
207 pci_unregister_driver(&driver);
208}
209
208module_init(it8213_ide_init); 210module_init(it8213_ide_init);
211module_exit(it8213_ide_exit);
209 212
210MODULE_AUTHOR("Jack Lee, Alan Cox"); 213MODULE_AUTHOR("Jack Lee, Alan Cox");
211MODULE_DESCRIPTION("PCI driver module for the ITE 8213"); 214MODULE_DESCRIPTION("PCI driver module for the ITE 8213");