unsigned int failed:1; /* Failure flag */
unsigned wanted:1; /* Parport sharing busy flag */
wait_queue_head_t *waiting;
+ struct Scsi_Host *host;
} ppa_struct;
#include "ppa.h"
static inline ppa_struct *ppa_dev(struct Scsi_Host *host)
{
- return &ppa_hosts[host->unique_id];
+ return *(ppa_struct **)&host->hostdata;
}
static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED;
int err;
int modes, ppb, ppb_hi;
+ memset(dev, 0, sizeof(dev));
dev->base = -1;
dev->mode = PPA_AUTODETECT;
dev->recon_tmo = PPA_RECON_TMO;
INIT_WORK(&dev->ppa_tq, ppa_interrupt, dev);
err = -ENOMEM;
- host = scsi_host_alloc(&ppa_template, 0);
+ host = scsi_host_alloc(&ppa_template, sizeof(ppa_struct *));
if (!host)
goto out;
list_add_tail(&host->sht_legacy_list, &ppa_template.legacy_hosts);
host->n_io_port = ports;
host->dma_channel = -1;
host->unique_id = dev - ppa_hosts;
+ *(ppa_struct **)&host->hostdata = dev;
+ dev->host = host;
err = scsi_add_host(host, NULL);
if (err)
goto out1;