aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-10-26 11:53:38 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-10-26 11:53:38 -0400
commit051275b2dfc315916d120a146368095bba328c69 (patch)
treec84a7c921b441f224618866cb5ed1d1caed5de1a
parent1902c94de0c5621726c0b05b55a2bb33e76268d6 (diff)
downloadseabios-hppa-051275b2dfc315916d120a146368095bba328c69.zip
seabios-hppa-051275b2dfc315916d120a146368095bba328c69.tar.gz
seabios-hppa-051275b2dfc315916d120a146368095bba328c69.tar.bz2
megasas: Don't attempt to access 'struct pci_device' at runtime.
The PCI device structures are only available during the POST phase. Don't attempt to access them from the runtime disk driver code. This patch has not been tested, but the old code is definitely incorrect. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/hw/megasas.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hw/megasas.c b/src/hw/megasas.c
index 3ded877..a5dc14f 100644
--- a/src/hw/megasas.c
+++ b/src/hw/megasas.c
@@ -109,9 +109,9 @@ struct mfi_ld_list_s {
struct megasas_lun_s {
struct drive_s drive;
- struct pci_device *pci;
struct megasas_cmd_frame *frame;
u32 iobase;
+ u16 pci_id;
u8 target;
u8 lun;
};
@@ -163,7 +163,7 @@ megasas_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize)
container_of(op->drive_gf, struct megasas_lun_s, drive);
u8 *cdb = cdbcmd;
struct megasas_cmd_frame *frame = GET_GLOBALFLAT(mlun_gf->frame);
- u16 pci_id = GET_GLOBALFLAT(mlun_gf->pci->device);
+ u16 pci_id = GET_GLOBALFLAT(mlun_gf->pci_id);
int i;
if (!CONFIG_MEGASAS)
@@ -212,7 +212,7 @@ megasas_add_lun(struct pci_device *pci, u32 iobase, u8 target, u8 lun)
memset(mlun, 0, sizeof(*mlun));
mlun->drive.type = DTYPE_MEGASAS;
mlun->drive.cntl_id = pci->bdf;
- mlun->pci = pci;
+ mlun->pci_id = pci->device;
mlun->target = target;
mlun->lun = lun;
mlun->iobase = iobase;