Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223608
b: refs/heads/master
c: 0dd2c96
h: refs/heads/master
v: v3
  • Loading branch information
Mingkai Hu authored and Grant Likely committed Dec 24, 2010
1 parent b299628 commit 0737de1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: e6289d63a6f39237a027dcee46366ba158cb8406
refs/heads/master: 0dd2c96f19b0cffaeb437e50fa5da195920c6e78
16 changes: 9 additions & 7 deletions trunk/drivers/spi/spi_fsl_espi.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,18 @@ static int fsl_espi_bufs(struct spi_device *spi, struct spi_transfer *t)
return mpc8xxx_spi->count;
}

static void fsl_espi_addr2cmd(unsigned int addr, u8 *cmd)
static inline void fsl_espi_addr2cmd(unsigned int addr, u8 *cmd)
{
if (cmd[1] && cmd[2] && cmd[3]) {
if (cmd) {
cmd[1] = (u8)(addr >> 16);
cmd[2] = (u8)(addr >> 8);
cmd[3] = (u8)(addr >> 0);
}
}

static unsigned int fsl_espi_cmd2addr(u8 *cmd)
static inline unsigned int fsl_espi_cmd2addr(u8 *cmd)
{
if (cmd[1] && cmd[2] && cmd[3])
if (cmd)
return cmd[1] << 16 | cmd[2] << 8 | cmd[3] << 0;

return 0;
Expand Down Expand Up @@ -395,9 +395,11 @@ static void fsl_espi_rw_trans(struct spi_message *m,
}
}

addr = fsl_espi_cmd2addr(local_buf);
addr += pos;
fsl_espi_addr2cmd(addr, local_buf);
if (pos > 0) {
addr = fsl_espi_cmd2addr(local_buf);
addr += pos;
fsl_espi_addr2cmd(addr, local_buf);
}

espi_trans->n_tx = n_tx;
espi_trans->n_rx = trans_len;
Expand Down

0 comments on commit 0737de1

Please sign in to comment.