Skip to content

Commit

Permalink
[PATCH] ide: core modifications for AU1200
Browse files Browse the repository at this point in the history
bart: slightly modified by me

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Jordan Crouse authored and Bartlomiej Zolnierkiewicz committed Dec 15, 2005
1 parent 38f9d41 commit 65e5f2e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
15 changes: 6 additions & 9 deletions drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@
#include <asm/io.h>
#include <asm/irq.h>

struct drive_list_entry {
const char *id_model;
const char *id_firmware;
};

static const struct drive_list_entry drive_whitelist [] = {

{ "Micropolis 2112A" , "ALL" },
Expand Down Expand Up @@ -139,15 +134,15 @@ static const struct drive_list_entry drive_blacklist [] = {
};

/**
* in_drive_list - look for drive in black/white list
* ide_in_drive_list - look for drive in black/white list
* @id: drive identifier
* @drive_table: list to inspect
*
* Look for a drive in the blacklist and the whitelist tables
* Returns 1 if the drive is found in the table.
*/

static int in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table)
int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table)
{
for ( ; drive_table->id_model ; drive_table++)
if ((!strcmp(drive_table->id_model, id->model)) &&
Expand All @@ -157,6 +152,8 @@ static int in_drive_list(struct hd_driveid *id, const struct drive_list_entry *d
return 0;
}

EXPORT_SYMBOL_GPL(ide_in_drive_list);

/**
* ide_dma_intr - IDE DMA interrupt handler
* @drive: the drive the interrupt is for
Expand Down Expand Up @@ -663,7 +660,7 @@ int __ide_dma_bad_drive (ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;

int blacklist = in_drive_list(id, drive_blacklist);
int blacklist = ide_in_drive_list(id, drive_blacklist);
if (blacklist) {
printk(KERN_WARNING "%s: Disabling (U)DMA for %s (blacklisted)\n",
drive->name, id->model);
Expand All @@ -677,7 +674,7 @@ EXPORT_SYMBOL(__ide_dma_bad_drive);
int __ide_dma_good_drive (ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
return in_drive_list(id, drive_whitelist);
return ide_in_drive_list(id, drive_whitelist);
}

EXPORT_SYMBOL(__ide_dma_good_drive);
Expand Down
5 changes: 0 additions & 5 deletions include/asm-mips/mach-au1x00/au1xxx_ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ typedef struct
} _auide_hwif;

#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
struct drive_list_entry {
const char * id_model;
const char * id_firmware;
};

/* HD white list */
static const struct drive_list_entry dma_white_list [] = {
/*
Expand Down
6 changes: 6 additions & 0 deletions include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,12 @@ void ide_init_sg_cmd(ide_drive_t *, struct request *);
#define GOOD_DMA_DRIVE 1

#ifdef CONFIG_BLK_DEV_IDEDMA
struct drive_list_entry {
const char *id_model;
const char *id_firmware;
};

int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
int __ide_dma_bad_drive(ide_drive_t *);
int __ide_dma_good_drive(ide_drive_t *);
int ide_use_dma(ide_drive_t *);
Expand Down

0 comments on commit 65e5f2e

Please sign in to comment.