Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ed0ef54 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent a182807a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
	drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
}

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

	return dev->irq;
	return 0;
}

static u8 atp86x_cable_detect(ide_hwif_t *hwif)
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ static int ali15x3_dma_setup(ide_drive_t *drive)
 *	appropriate also sets up the 1533 southbridge.
 */

static unsigned int init_chipset_ali15x3(struct pci_dev *dev)
static int init_chipset_ali15x3(struct pci_dev *dev)
{
	unsigned long flags;
	u8 tmpbyte;
+2 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ static void amd7411_cable_detect(struct pci_dev *dev)
 * The initialization callback.  Initialize drive independent registers.
 */

static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
static int init_chipset_amd74xx(struct pci_dev *dev)
{
	u8 t = 0, offset = amd_offset(dev);

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

	return dev->irq;
	return 0;
}

static u8 amd_cable_detect(ide_hwif_t *hwif)
+1 −1
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ static int cmd646_1_dma_end(ide_drive_t *drive)
	return (dma_stat & 7) != 4;
}

static unsigned int init_chipset_cmd64x(struct pci_dev *dev)
static int init_chipset_cmd64x(struct pci_dev *dev)
{
	u8 mrdmode = 0;

+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode)
 *	Initialize the cs5530 bridge for reliable IDE DMA operation.
 */

static unsigned int init_chipset_cs5530(struct pci_dev *dev)
static int init_chipset_cs5530(struct pci_dev *dev)
{
	struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;

Loading