Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114200
b: refs/heads/master
c: a36223b
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 13, 2008
1 parent 0bebe0b commit e074453
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf4049103be931fca133f66b3181490284a521c6
refs/heads/master: a36223b0dc14606b5c80aacbbe6288133693a841
31 changes: 9 additions & 22 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,8 +1544,7 @@ static void ide_free_port_slot(int idx)
mutex_unlock(&ide_cfg_mtx);
}

struct ide_host *ide_host_alloc_all(const struct ide_port_info *d,
hw_regs_t **hws)
struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
{
struct ide_host *host;
int i;
Expand All @@ -1554,7 +1553,7 @@ struct ide_host *ide_host_alloc_all(const struct ide_port_info *d,
if (host == NULL)
return NULL;

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
ide_hwif_t *hwif;
int idx;

Expand Down Expand Up @@ -1596,18 +1595,6 @@ struct ide_host *ide_host_alloc_all(const struct ide_port_info *d,

return host;
}
EXPORT_SYMBOL_GPL(ide_host_alloc_all);

struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
{
hw_regs_t *hws_all[MAX_HWIFS];
int i;

for (i = 0; i < MAX_HWIFS; i++)
hws_all[i] = (i < 4) ? hws[i] : NULL;

return ide_host_alloc_all(d, hws_all);
}
EXPORT_SYMBOL_GPL(ide_host_alloc);

int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
Expand All @@ -1616,7 +1603,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_hwif_t *hwif, *mate = NULL;
int i, j = 0;

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
hwif = host->ports[i];

if (hwif == NULL) {
Expand Down Expand Up @@ -1644,7 +1631,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_port_init_devices(hwif);
}

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
hwif = host->ports[i];

if (hwif == NULL)
Expand All @@ -1661,7 +1648,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_port_tune_devices(hwif);
}

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
hwif = host->ports[i];

if (hwif == NULL)
Expand All @@ -1685,7 +1672,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_acpi_port_init_devices(hwif);
}

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
hwif = host->ports[i];

if (hwif == NULL)
Expand All @@ -1698,7 +1685,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
hwif_register_devices(hwif);
}

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
hwif = host->ports[i];

if (hwif == NULL)
Expand Down Expand Up @@ -1743,7 +1730,7 @@ void ide_host_free(struct ide_host *host)
ide_hwif_t *hwif;
int i;

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
hwif = host->ports[i];

if (hwif == NULL)
Expand All @@ -1761,7 +1748,7 @@ void ide_host_remove(struct ide_host *host)
{
int i;

for (i = 0; i < MAX_HWIFS; i++) {
for (i = 0; i < MAX_HOST_PORTS; i++) {
if (host->ports[i])
ide_unregister(host->ports[i]);
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,10 @@ typedef struct hwif_s {
#endif
} ____cacheline_internodealigned_in_smp ide_hwif_t;

#define MAX_HOST_PORTS 4

struct ide_host {
ide_hwif_t *ports[MAX_HWIFS];
ide_hwif_t *ports[MAX_HOST_PORTS];
unsigned int n_ports;
struct device *dev[2];
unsigned int (*init_chipset)(struct pci_dev *);
Expand Down Expand Up @@ -1479,7 +1481,6 @@ void ide_undecoded_slave(ide_drive_t *);

void ide_port_apply_params(ide_hwif_t *);

struct ide_host *ide_host_alloc_all(const struct ide_port_info *, hw_regs_t **);
struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **);
void ide_host_free(struct ide_host *);
int ide_host_register(struct ide_host *, const struct ide_port_info *,
Expand Down

0 comments on commit e074453

Please sign in to comment.