From: Wilfried Weissmann <wilfried.weissmann@xxxxxx> --- drivers/scsi/mvsas/mv_94xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mvsas/mv_94xx.c b/drivers/scsi/mvsas/mv_94xx.c index 7de5d8d75..926086f39 100644 --- a/drivers/scsi/mvsas/mv_94xx.c +++ b/drivers/scsi/mvsas/mv_94xx.c @@ -1088,7 +1088,7 @@ static int mvs_94xx_gpio_write(struct mvs_prv_info *mvs_prv, * if bit is set then create a mask with the first * bit of the drive set in the mask ... */ - u32 bit = (write_data[i/8] & (1 << (i&(8-1)))) ? + u32 bit = (write_data[3-(i/8)] & (1 << (i&(8-1)))) ? 1<<(24-drive*8) : 0; /* @@ -1132,7 +1132,7 @@ static int mvs_94xx_gpio_write(struct mvs_prv_info *mvs_prv, void __iomem *regs = mvi->regs_ex - 0x10200; mw32(MVS_SGPIO_DCTRL + MVS_SGPIO_HOST_OFFSET * mvi->id, - be32_to_cpu(((u32 *) write_data)[i])); + le32_to_cpu(((u32 *) write_data)[i])); } return reg_count; }