Skip to content

Commit 2ed0ef5

Browse files
committed
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>
1 parent a182807 commit 2ed0ef5

18 files changed

Lines changed: 26 additions & 26 deletions

‎drivers/ide/aec62xx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
139139
drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
140140
}
141141

142-
static unsigned int init_chipset_aec62xx(struct pci_dev *dev)
142+
static int init_chipset_aec62xx(struct pci_dev *dev)
143143
{
144144
/* These are necessary to get AEC6280 Macintosh cards to work */
145145
if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) ||
@@ -156,7 +156,7 @@ static unsigned int init_chipset_aec62xx(struct pci_dev *dev)
156156
pci_write_config_byte(dev, 0x4a, reg4ah | 0x80);
157157
}
158158

159-
return dev->irq;
159+
return 0;
160160
}
161161

162162
static u8 atp86x_cable_detect(ide_hwif_t *hwif)

‎drivers/ide/alim15x3.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static int ali15x3_dma_setup(ide_drive_t *drive)
212212
* appropriate also sets up the 1533 southbridge.
213213
*/
214214

215-
static unsigned int init_chipset_ali15x3(struct pci_dev *dev)
215+
static int init_chipset_ali15x3(struct pci_dev *dev)
216216
{
217217
unsigned long flags;
218218
u8 tmpbyte;

‎drivers/ide/amd74xx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static void amd7411_cable_detect(struct pci_dev *dev)
140140
* The initialization callback. Initialize drive independent registers.
141141
*/
142142

143-
static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
143+
static int init_chipset_amd74xx(struct pci_dev *dev)
144144
{
145145
u8 t = 0, offset = amd_offset(dev);
146146

@@ -172,7 +172,7 @@ static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
172172
t |= 0xf0;
173173
pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t);
174174

175-
return dev->irq;
175+
return 0;
176176
}
177177

178178
static u8 amd_cable_detect(ide_hwif_t *hwif)

‎drivers/ide/cmd64x.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static int cmd646_1_dma_end(ide_drive_t *drive)
333333
return (dma_stat & 7) != 4;
334334
}
335335

336-
static unsigned int init_chipset_cmd64x(struct pci_dev *dev)
336+
static int init_chipset_cmd64x(struct pci_dev *dev)
337337
{
338338
u8 mrdmode = 0;
339339

‎drivers/ide/cs5530.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode)
135135
* Initialize the cs5530 bridge for reliable IDE DMA operation.
136136
*/
137137

138-
static unsigned int init_chipset_cs5530(struct pci_dev *dev)
138+
static int init_chipset_cs5530(struct pci_dev *dev)
139139
{
140140
struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
141141

‎drivers/ide/delkin_cb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static const struct ide_port_ops delkin_cb_port_ops = {
4646
.quirkproc = ide_undecoded_slave,
4747
};
4848

49-
static unsigned int delkin_cb_init_chipset(struct pci_dev *dev)
49+
static int delkin_cb_init_chipset(struct pci_dev *dev)
5050
{
5151
unsigned long base = pci_resource_start(dev, 0);
5252
int i;

‎drivers/ide/hpt366.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ static void hpt3xx_disable_fast_irq(struct pci_dev *dev, u8 mcr_addr)
995995
pci_write_config_byte(dev, mcr_addr + 1, new_mcr);
996996
}
997997

998-
static unsigned int init_chipset_hpt366(struct pci_dev *dev)
998+
static int init_chipset_hpt366(struct pci_dev *dev)
999999
{
10001000
unsigned long io_base = pci_resource_start(dev, 4);
10011001
struct hpt_info *info = hpt3xx_get_info(&dev->dev);
@@ -1237,7 +1237,7 @@ static unsigned int init_chipset_hpt366(struct pci_dev *dev)
12371237
hpt3xx_disable_fast_irq(dev, 0x50);
12381238
hpt3xx_disable_fast_irq(dev, 0x54);
12391239

1240-
return dev->irq;
1240+
return 0;
12411241
}
12421242

12431243
static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)

‎drivers/ide/it821x.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static void it8212_disable_raid(struct pci_dev *dev)
603603
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20);
604604
}
605605

606-
static unsigned int init_chipset_it821x(struct pci_dev *dev)
606+
static int init_chipset_it821x(struct pci_dev *dev)
607607
{
608608
u8 conf;
609609
static char *mode[2] = { "pass through", "smart" };

‎drivers/ide/pdc202xx_new.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static void apple_kiwi_init(struct pci_dev *pdev)
325325
}
326326
#endif /* CONFIG_PPC_PMAC */
327327

328-
static unsigned int init_chipset_pdcnew(struct pci_dev *dev)
328+
static int init_chipset_pdcnew(struct pci_dev *dev)
329329
{
330330
const char *name = DRV_NAME;
331331
unsigned long dma_base = pci_resource_start(dev, 4);
@@ -444,7 +444,7 @@ static unsigned int init_chipset_pdcnew(struct pci_dev *dev)
444444
#endif
445445

446446
out:
447-
return dev->irq;
447+
return 0;
448448
}
449449

450450
static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev)

‎drivers/ide/pdc202xx_old.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static void pdc202xx_dma_timeout(ide_drive_t *drive)
264264
ide_dma_timeout(drive);
265265
}
266266

267-
static unsigned int init_chipset_pdc202xx(struct pci_dev *dev)
267+
static int init_chipset_pdc202xx(struct pci_dev *dev)
268268
{
269269
unsigned long dmabase = pci_resource_start(dev, 4);
270270
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)
290290
printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN");
291291
}
292292
out:
293-
return dev->irq;
293+
return 0;
294294
}
295295

296296
static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,

0 commit comments

Comments
 (0)