diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:53 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:53 -0400 |
commit | 2ed0ef543ae3f3ea4f8bd0433fb1fed22625a309 (patch) | |
tree | 44777820dcef08ed0fc4b9583bf982220ba15154 | |
parent | a182807a89946bd531122bb2da60fa9ceee90343 (diff) |
ide: fix ->init_chipset method to return 'int' value
* Return 0 instead of dev->irq in ->init_chipset implementations.
* Fix ->init_chipset method to return 'int' value instead of
'unsigned int' one.
This fixes ->init_chipset handling for host drivers (cs5530, hpt366
and pdc202xx_new) for which it is possible for this method to fail.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/aec62xx.c | 4 | ||||
-rw-r--r-- | drivers/ide/alim15x3.c | 2 | ||||
-rw-r--r-- | drivers/ide/amd74xx.c | 4 | ||||
-rw-r--r-- | drivers/ide/cmd64x.c | 2 | ||||
-rw-r--r-- | drivers/ide/cs5530.c | 2 | ||||
-rw-r--r-- | drivers/ide/delkin_cb.c | 2 | ||||
-rw-r--r-- | drivers/ide/hpt366.c | 4 | ||||
-rw-r--r-- | drivers/ide/it821x.c | 2 | ||||
-rw-r--r-- | drivers/ide/pdc202xx_new.c | 4 | ||||
-rw-r--r-- | drivers/ide/pdc202xx_old.c | 4 | ||||
-rw-r--r-- | drivers/ide/piix.c | 2 | ||||
-rw-r--r-- | drivers/ide/serverworks.c | 4 | ||||
-rw-r--r-- | drivers/ide/setup-pci.c | 2 | ||||
-rw-r--r-- | drivers/ide/siimage.c | 2 | ||||
-rw-r--r-- | drivers/ide/sis5513.c | 2 | ||||
-rw-r--r-- | drivers/ide/sl82c105.c | 4 | ||||
-rw-r--r-- | drivers/ide/via82cxxx.c | 2 | ||||
-rw-r--r-- | include/linux/ide.h | 4 |
18 files changed, 26 insertions, 26 deletions
diff --git a/drivers/ide/aec62xx.c b/drivers/ide/aec62xx.c index 4485b9c6f0e6..878f8ec6dbe1 100644 --- a/drivers/ide/aec62xx.c +++ b/drivers/ide/aec62xx.c | |||
@@ -139,7 +139,7 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
139 | drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0); | 139 | drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0); |
140 | } | 140 | } |
141 | 141 | ||
142 | static unsigned int init_chipset_aec62xx(struct pci_dev *dev) | 142 | static int init_chipset_aec62xx(struct pci_dev *dev) |
143 | { | 143 | { |
144 | /* These are necessary to get AEC6280 Macintosh cards to work */ | 144 | /* These are necessary to get AEC6280 Macintosh cards to work */ |
145 | if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) || | 145 | if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) || |
@@ -156,7 +156,7 @@ static unsigned int init_chipset_aec62xx(struct pci_dev *dev) | |||
156 | pci_write_config_byte(dev, 0x4a, reg4ah | 0x80); | 156 | pci_write_config_byte(dev, 0x4a, reg4ah | 0x80); |
157 | } | 157 | } |
158 | 158 | ||
159 | return dev->irq; | 159 | return 0; |
160 | } | 160 | } |
161 | 161 | ||
162 | static u8 atp86x_cable_detect(ide_hwif_t *hwif) | 162 | static u8 atp86x_cable_detect(ide_hwif_t *hwif) |
diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c index 66f43083408b..d3513b6b8530 100644 --- a/drivers/ide/alim15x3.c +++ b/drivers/ide/alim15x3.c | |||
@@ -212,7 +212,7 @@ static int ali15x3_dma_setup(ide_drive_t *drive) | |||
212 | * appropriate also sets up the 1533 southbridge. | 212 | * appropriate also sets up the 1533 southbridge. |
213 | */ | 213 | */ |
214 | 214 | ||
215 | static unsigned int init_chipset_ali15x3(struct pci_dev *dev) | 215 | static int init_chipset_ali15x3(struct pci_dev *dev) |
216 | { | 216 | { |
217 | unsigned long flags; | 217 | unsigned long flags; |
218 | u8 tmpbyte; | 218 | u8 tmpbyte; |
diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c index 0b51921e63e6..628cd2e5fed8 100644 --- a/drivers/ide/amd74xx.c +++ b/drivers/ide/amd74xx.c | |||
@@ -140,7 +140,7 @@ static void amd7411_cable_detect(struct pci_dev *dev) | |||
140 | * The initialization callback. Initialize drive independent registers. | 140 | * The initialization callback. Initialize drive independent registers. |
141 | */ | 141 | */ |
142 | 142 | ||
143 | static unsigned int init_chipset_amd74xx(struct pci_dev *dev) | 143 | static int init_chipset_amd74xx(struct pci_dev *dev) |
144 | { | 144 | { |
145 | u8 t = 0, offset = amd_offset(dev); | 145 | u8 t = 0, offset = amd_offset(dev); |
146 | 146 | ||
@@ -172,7 +172,7 @@ static unsigned int init_chipset_amd74xx(struct pci_dev *dev) | |||
172 | t |= 0xf0; | 172 | t |= 0xf0; |
173 | pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t); | 173 | pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t); |
174 | 174 | ||
175 | return dev->irq; | 175 | return 0; |
176 | } | 176 | } |
177 | 177 | ||
178 | static u8 amd_cable_detect(ide_hwif_t *hwif) | 178 | static u8 amd_cable_detect(ide_hwif_t *hwif) |
diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c index 2f9688d87ecd..aeee036b1503 100644 --- a/drivers/ide/cmd64x.c +++ b/drivers/ide/cmd64x.c | |||
@@ -333,7 +333,7 @@ static int cmd646_1_dma_end(ide_drive_t *drive) | |||
333 | return (dma_stat & 7) != 4; | 333 | return (dma_stat & 7) != 4; |
334 | } | 334 | } |
335 | 335 | ||
336 | static unsigned int init_chipset_cmd64x(struct pci_dev *dev) | 336 | static int init_chipset_cmd64x(struct pci_dev *dev) |
337 | { | 337 | { |
338 | u8 mrdmode = 0; | 338 | u8 mrdmode = 0; |
339 | 339 | ||
diff --git a/drivers/ide/cs5530.c b/drivers/ide/cs5530.c index d8ede85fe17f..8e8b35a89901 100644 --- a/drivers/ide/cs5530.c +++ b/drivers/ide/cs5530.c | |||
@@ -135,7 +135,7 @@ static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode) | |||
135 | * Initialize the cs5530 bridge for reliable IDE DMA operation. | 135 | * Initialize the cs5530 bridge for reliable IDE DMA operation. |
136 | */ | 136 | */ |
137 | 137 | ||
138 | static unsigned int init_chipset_cs5530(struct pci_dev *dev) | 138 | static int init_chipset_cs5530(struct pci_dev *dev) |
139 | { | 139 | { |
140 | struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; | 140 | struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; |
141 | 141 | ||
diff --git a/drivers/ide/delkin_cb.c b/drivers/ide/delkin_cb.c index 8f1b2d9f0513..bacb1194c9c9 100644 --- a/drivers/ide/delkin_cb.c +++ b/drivers/ide/delkin_cb.c | |||
@@ -46,7 +46,7 @@ static const struct ide_port_ops delkin_cb_port_ops = { | |||
46 | .quirkproc = ide_undecoded_slave, | 46 | .quirkproc = ide_undecoded_slave, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static unsigned int delkin_cb_init_chipset(struct pci_dev *dev) | 49 | static int delkin_cb_init_chipset(struct pci_dev *dev) |
50 | { | 50 | { |
51 | unsigned long base = pci_resource_start(dev, 0); | 51 | unsigned long base = pci_resource_start(dev, 0); |
52 | int i; | 52 | int i; |
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index 3eb9b5c63a0f..d3b3e824f445 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c | |||
@@ -995,7 +995,7 @@ static void hpt3xx_disable_fast_irq(struct pci_dev *dev, u8 mcr_addr) | |||
995 | pci_write_config_byte(dev, mcr_addr + 1, new_mcr); | 995 | pci_write_config_byte(dev, mcr_addr + 1, new_mcr); |
996 | } | 996 | } |
997 | 997 | ||
998 | static unsigned int init_chipset_hpt366(struct pci_dev *dev) | 998 | static int init_chipset_hpt366(struct pci_dev *dev) |
999 | { | 999 | { |
1000 | unsigned long io_base = pci_resource_start(dev, 4); | 1000 | unsigned long io_base = pci_resource_start(dev, 4); |
1001 | struct hpt_info *info = hpt3xx_get_info(&dev->dev); | 1001 | struct hpt_info *info = hpt3xx_get_info(&dev->dev); |
@@ -1237,7 +1237,7 @@ static unsigned int init_chipset_hpt366(struct pci_dev *dev) | |||
1237 | hpt3xx_disable_fast_irq(dev, 0x50); | 1237 | hpt3xx_disable_fast_irq(dev, 0x50); |
1238 | hpt3xx_disable_fast_irq(dev, 0x54); | 1238 | hpt3xx_disable_fast_irq(dev, 0x54); |
1239 | 1239 | ||
1240 | return dev->irq; | 1240 | return 0; |
1241 | } | 1241 | } |
1242 | 1242 | ||
1243 | static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) | 1243 | static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) |
diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c index 13b8153112ed..6b9fc950b4af 100644 --- a/drivers/ide/it821x.c +++ b/drivers/ide/it821x.c | |||
@@ -603,7 +603,7 @@ static void it8212_disable_raid(struct pci_dev *dev) | |||
603 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20); | 603 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20); |
604 | } | 604 | } |
605 | 605 | ||
606 | static unsigned int init_chipset_it821x(struct pci_dev *dev) | 606 | static int init_chipset_it821x(struct pci_dev *dev) |
607 | { | 607 | { |
608 | u8 conf; | 608 | u8 conf; |
609 | static char *mode[2] = { "pass through", "smart" }; | 609 | static char *mode[2] = { "pass through", "smart" }; |
diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c index f21290c4b447..b68906c3c17e 100644 --- a/drivers/ide/pdc202xx_new.c +++ b/drivers/ide/pdc202xx_new.c | |||
@@ -325,7 +325,7 @@ static void apple_kiwi_init(struct pci_dev *pdev) | |||
325 | } | 325 | } |
326 | #endif /* CONFIG_PPC_PMAC */ | 326 | #endif /* CONFIG_PPC_PMAC */ |
327 | 327 | ||
328 | static unsigned int init_chipset_pdcnew(struct pci_dev *dev) | 328 | static int init_chipset_pdcnew(struct pci_dev *dev) |
329 | { | 329 | { |
330 | const char *name = DRV_NAME; | 330 | const char *name = DRV_NAME; |
331 | unsigned long dma_base = pci_resource_start(dev, 4); | 331 | unsigned long dma_base = pci_resource_start(dev, 4); |
@@ -444,7 +444,7 @@ static unsigned int init_chipset_pdcnew(struct pci_dev *dev) | |||
444 | #endif | 444 | #endif |
445 | 445 | ||
446 | out: | 446 | out: |
447 | return dev->irq; | 447 | return 0; |
448 | } | 448 | } |
449 | 449 | ||
450 | static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) | 450 | static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) |
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c index 97193323aebf..cba66ebce4e3 100644 --- a/drivers/ide/pdc202xx_old.c +++ b/drivers/ide/pdc202xx_old.c | |||
@@ -264,7 +264,7 @@ static void pdc202xx_dma_timeout(ide_drive_t *drive) | |||
264 | ide_dma_timeout(drive); | 264 | ide_dma_timeout(drive); |
265 | } | 265 | } |
266 | 266 | ||
267 | static unsigned int init_chipset_pdc202xx(struct pci_dev *dev) | 267 | static int init_chipset_pdc202xx(struct pci_dev *dev) |
268 | { | 268 | { |
269 | unsigned long dmabase = pci_resource_start(dev, 4); | 269 | unsigned long dmabase = pci_resource_start(dev, 4); |
270 | u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0; | 270 | u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0; |
@@ -290,7 +290,7 @@ static unsigned int init_chipset_pdc202xx(struct pci_dev *dev) | |||
290 | printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN"); | 290 | printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN"); |
291 | } | 291 | } |
292 | out: | 292 | out: |
293 | return dev->irq; | 293 | return 0; |
294 | } | 294 | } |
295 | 295 | ||
296 | static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev, | 296 | static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev, |
diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c index 42c2e3522d74..2aa699933064 100644 --- a/drivers/ide/piix.c +++ b/drivers/ide/piix.c | |||
@@ -204,7 +204,7 @@ static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
204 | * out to be nice and simple. | 204 | * out to be nice and simple. |
205 | */ | 205 | */ |
206 | 206 | ||
207 | static unsigned int init_chipset_ich(struct pci_dev *dev) | 207 | static int init_chipset_ich(struct pci_dev *dev) |
208 | { | 208 | { |
209 | u32 extra = 0; | 209 | u32 extra = 0; |
210 | 210 | ||
diff --git a/drivers/ide/serverworks.c b/drivers/ide/serverworks.c index 14718e73991e..b6554ef92716 100644 --- a/drivers/ide/serverworks.c +++ b/drivers/ide/serverworks.c | |||
@@ -175,7 +175,7 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
175 | pci_write_config_byte(dev, 0x54, ultra_enable); | 175 | pci_write_config_byte(dev, 0x54, ultra_enable); |
176 | } | 176 | } |
177 | 177 | ||
178 | static unsigned int init_chipset_svwks(struct pci_dev *dev) | 178 | static int init_chipset_svwks(struct pci_dev *dev) |
179 | { | 179 | { |
180 | unsigned int reg; | 180 | unsigned int reg; |
181 | u8 btr; | 181 | u8 btr; |
@@ -270,7 +270,7 @@ static unsigned int init_chipset_svwks(struct pci_dev *dev) | |||
270 | pci_write_config_byte(dev, 0x5A, btr); | 270 | pci_write_config_byte(dev, 0x5A, btr); |
271 | } | 271 | } |
272 | 272 | ||
273 | return dev->irq; | 273 | return 0; |
274 | } | 274 | } |
275 | 275 | ||
276 | static u8 ata66_svwks_svwks(ide_hwif_t *hwif) | 276 | static u8 ata66_svwks_svwks(ide_hwif_t *hwif) |
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 79e3244691ec..75e3beca86f0 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -524,7 +524,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, | |||
524 | if (noisy) | 524 | if (noisy) |
525 | printk(KERN_INFO "%s %s: not 100%% native mode: will " | 525 | printk(KERN_INFO "%s %s: not 100%% native mode: will " |
526 | "probe irqs later\n", d->name, pci_name(dev)); | 526 | "probe irqs later\n", d->name, pci_name(dev)); |
527 | pciirq = ret; | 527 | pciirq = 0; |
528 | } else if (!pciirq && noisy) { | 528 | } else if (!pciirq && noisy) { |
529 | printk(KERN_WARNING "%s %s: bad irq (%d): will probe later\n", | 529 | printk(KERN_WARNING "%s %s: bad irq (%d): will probe later\n", |
530 | d->name, pci_name(dev), pciirq); | 530 | d->name, pci_name(dev), pciirq); |
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c index cb2b352b876b..1811ae9cd843 100644 --- a/drivers/ide/siimage.c +++ b/drivers/ide/siimage.c | |||
@@ -464,7 +464,7 @@ static void sil_sata_pre_reset(ide_drive_t *drive) | |||
464 | * to 133 MHz clocking if the system isn't already set up to do it. | 464 | * to 133 MHz clocking if the system isn't already set up to do it. |
465 | */ | 465 | */ |
466 | 466 | ||
467 | static unsigned int init_chipset_siimage(struct pci_dev *dev) | 467 | static int init_chipset_siimage(struct pci_dev *dev) |
468 | { | 468 | { |
469 | struct ide_host *host = pci_get_drvdata(dev); | 469 | struct ide_host *host = pci_get_drvdata(dev); |
470 | void __iomem *ioaddr = host->host_priv; | 470 | void __iomem *ioaddr = host->host_priv; |
diff --git a/drivers/ide/sis5513.c b/drivers/ide/sis5513.c index d2d54aaea13a..afca22beaadf 100644 --- a/drivers/ide/sis5513.c +++ b/drivers/ide/sis5513.c | |||
@@ -447,7 +447,7 @@ static int __devinit sis_find_family(struct pci_dev *dev) | |||
447 | return chipset_family; | 447 | return chipset_family; |
448 | } | 448 | } |
449 | 449 | ||
450 | static unsigned int init_chipset_sis5513(struct pci_dev *dev) | 450 | static int init_chipset_sis5513(struct pci_dev *dev) |
451 | { | 451 | { |
452 | /* Make general config ops here | 452 | /* Make general config ops here |
453 | 1/ tell IDE channels to operate in Compatibility mode only | 453 | 1/ tell IDE channels to operate in Compatibility mode only |
diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c index 6297956507c0..dba213c51baa 100644 --- a/drivers/ide/sl82c105.c +++ b/drivers/ide/sl82c105.c | |||
@@ -271,7 +271,7 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev) | |||
271 | * channel 0 here at least, but channel 1 has to be enabled by | 271 | * channel 0 here at least, but channel 1 has to be enabled by |
272 | * firmware or arch code. We still set both to 16 bits mode. | 272 | * firmware or arch code. We still set both to 16 bits mode. |
273 | */ | 273 | */ |
274 | static unsigned int init_chipset_sl82c105(struct pci_dev *dev) | 274 | static int init_chipset_sl82c105(struct pci_dev *dev) |
275 | { | 275 | { |
276 | u32 val; | 276 | u32 val; |
277 | 277 | ||
@@ -281,7 +281,7 @@ static unsigned int init_chipset_sl82c105(struct pci_dev *dev) | |||
281 | val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16; | 281 | val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16; |
282 | pci_write_config_dword(dev, 0x40, val); | 282 | pci_write_config_dword(dev, 0x40, val); |
283 | 283 | ||
284 | return dev->irq; | 284 | return 0; |
285 | } | 285 | } |
286 | 286 | ||
287 | static const struct ide_port_ops sl82c105_port_ops = { | 287 | static const struct ide_port_ops sl82c105_port_ops = { |
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c index a41eab5cb5df..3ff7231e4858 100644 --- a/drivers/ide/via82cxxx.c +++ b/drivers/ide/via82cxxx.c | |||
@@ -267,7 +267,7 @@ static void via_cable_detect(struct via82cxxx_dev *vdev, u32 u) | |||
267 | * and initialize its drive independent registers. | 267 | * and initialize its drive independent registers. |
268 | */ | 268 | */ |
269 | 269 | ||
270 | static unsigned int init_chipset_via82cxxx(struct pci_dev *dev) | 270 | static int init_chipset_via82cxxx(struct pci_dev *dev) |
271 | { | 271 | { |
272 | struct ide_host *host = pci_get_drvdata(dev); | 272 | struct ide_host *host = pci_get_drvdata(dev); |
273 | struct via82cxxx_dev *vdev = host->host_priv; | 273 | struct via82cxxx_dev *vdev = host->host_priv; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 31e492c7bdef..117dd171e70b 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -851,7 +851,7 @@ struct ide_host { | |||
851 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; | 851 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; |
852 | unsigned int n_ports; | 852 | unsigned int n_ports; |
853 | struct device *dev[2]; | 853 | struct device *dev[2]; |
854 | unsigned int (*init_chipset)(struct pci_dev *); | 854 | int (*init_chipset)(struct pci_dev *); |
855 | irq_handler_t irq_handler; | 855 | irq_handler_t irq_handler; |
856 | unsigned long host_flags; | 856 | unsigned long host_flags; |
857 | void *host_priv; | 857 | void *host_priv; |
@@ -1361,7 +1361,7 @@ enum { | |||
1361 | 1361 | ||
1362 | struct ide_port_info { | 1362 | struct ide_port_info { |
1363 | char *name; | 1363 | char *name; |
1364 | unsigned int (*init_chipset)(struct pci_dev *); | 1364 | int (*init_chipset)(struct pci_dev *); |
1365 | void (*init_iops)(ide_hwif_t *); | 1365 | void (*init_iops)(ide_hwif_t *); |
1366 | void (*init_hwif)(ide_hwif_t *); | 1366 | void (*init_hwif)(ide_hwif_t *); |
1367 | int (*init_dma)(ide_hwif_t *, | 1367 | int (*init_dma)(ide_hwif_t *, |