diff options
Diffstat (limited to 'drivers/ide/pci/hpt34x.c')
-rw-r--r-- | drivers/ide/pci/hpt34x.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index 9e1d1c4741da..6009b0b9655d 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <linux/ide.h> | 34 | #include <linux/ide.h> |
35 | 35 | ||
36 | #define DRV_NAME "hpt34x" | ||
37 | |||
36 | #define HPT343_DEBUG_DRIVE_INFO 0 | 38 | #define HPT343_DEBUG_DRIVE_INFO 0 |
37 | 39 | ||
38 | static void hpt34x_set_mode(ide_drive_t *drive, const u8 speed) | 40 | static void hpt34x_set_mode(ide_drive_t *drive, const u8 speed) |
@@ -77,7 +79,7 @@ static void hpt34x_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
77 | */ | 79 | */ |
78 | #define HPT34X_PCI_INIT_REG 0x80 | 80 | #define HPT34X_PCI_INIT_REG 0x80 |
79 | 81 | ||
80 | static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const char *name) | 82 | static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev) |
81 | { | 83 | { |
82 | int i = 0; | 84 | int i = 0; |
83 | unsigned long hpt34xIoBase = pci_resource_start(dev, 4); | 85 | unsigned long hpt34xIoBase = pci_resource_start(dev, 4); |
@@ -126,15 +128,15 @@ static const struct ide_port_ops hpt34x_port_ops = { | |||
126 | IDE_HFLAG_NO_AUTODMA) | 128 | IDE_HFLAG_NO_AUTODMA) |
127 | 129 | ||
128 | static const struct ide_port_info hpt34x_chipsets[] __devinitdata = { | 130 | static const struct ide_port_info hpt34x_chipsets[] __devinitdata = { |
129 | { /* 0 */ | 131 | { /* 0: HPT343 */ |
130 | .name = "HPT343", | 132 | .name = DRV_NAME, |
131 | .init_chipset = init_chipset_hpt34x, | 133 | .init_chipset = init_chipset_hpt34x, |
132 | .port_ops = &hpt34x_port_ops, | 134 | .port_ops = &hpt34x_port_ops, |
133 | .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_NON_BOOTABLE, | 135 | .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_NON_BOOTABLE, |
134 | .pio_mask = ATA_PIO5, | 136 | .pio_mask = ATA_PIO5, |
135 | }, | 137 | }, |
136 | { /* 1 */ | 138 | { /* 1: HPT345 */ |
137 | .name = "HPT345", | 139 | .name = DRV_NAME, |
138 | .init_chipset = init_chipset_hpt34x, | 140 | .init_chipset = init_chipset_hpt34x, |
139 | .port_ops = &hpt34x_port_ops, | 141 | .port_ops = &hpt34x_port_ops, |
140 | .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_OFF_BOARD, | 142 | .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_OFF_BOARD, |
@@ -156,7 +158,7 @@ static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_devic | |||
156 | 158 | ||
157 | d = &hpt34x_chipsets[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]; | 159 | d = &hpt34x_chipsets[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]; |
158 | 160 | ||
159 | return ide_setup_pci_device(dev, d); | 161 | return ide_pci_init_one(dev, d, NULL); |
160 | } | 162 | } |
161 | 163 | ||
162 | static const struct pci_device_id hpt34x_pci_tbl[] = { | 164 | static const struct pci_device_id hpt34x_pci_tbl[] = { |
@@ -169,6 +171,7 @@ static struct pci_driver driver = { | |||
169 | .name = "HPT34x_IDE", | 171 | .name = "HPT34x_IDE", |
170 | .id_table = hpt34x_pci_tbl, | 172 | .id_table = hpt34x_pci_tbl, |
171 | .probe = hpt34x_init_one, | 173 | .probe = hpt34x_init_one, |
174 | .remove = ide_pci_remove, | ||
172 | }; | 175 | }; |
173 | 176 | ||
174 | static int __init hpt34x_ide_init(void) | 177 | static int __init hpt34x_ide_init(void) |
@@ -176,7 +179,13 @@ static int __init hpt34x_ide_init(void) | |||
176 | return ide_pci_register_driver(&driver); | 179 | return ide_pci_register_driver(&driver); |
177 | } | 180 | } |
178 | 181 | ||
182 | static void __exit hpt34x_ide_exit(void) | ||
183 | { | ||
184 | pci_unregister_driver(&driver); | ||
185 | } | ||
186 | |||
179 | module_init(hpt34x_ide_init); | 187 | module_init(hpt34x_ide_init); |
188 | module_exit(hpt34x_ide_exit); | ||
180 | 189 | ||
181 | MODULE_AUTHOR("Andre Hedrick"); | 190 | MODULE_AUTHOR("Andre Hedrick"); |
182 | MODULE_DESCRIPTION("PCI driver module for Highpoint 34x IDE"); | 191 | MODULE_DESCRIPTION("PCI driver module for Highpoint 34x IDE"); |