mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
dmascc: use proper 'virt_to_bus()' rather than casting to 'int'
The old dmascc driver depends on the legacy ISA_DMA_API, and blindly just casts the kernel virtual address to 'int' for set_dma_addr(). That works only incidentally, and because the high bits of the address will be ignored anyway. And on 64-bit architectures it causes warnings. Admittedly, 64-bit architectures with ISA are basically dead - I think the only example of this is alpha, and nobody would ever use the dmascc driver there. But hey, the fix is easy enough, the end result is cleaner, and it's yet another configuration that now builds without warnings. If somebody actually uses this driver on an alpha and this fixes it for you, please email me. Because that is just incredibly bizarre. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4fef611590
commit
bc1abb9e55
1 changed files with 3 additions and 3 deletions
|
@ -973,7 +973,7 @@ static inline void tx_on(struct scc_priv *priv)
|
|||
flags = claim_dma_lock();
|
||||
set_dma_mode(priv->param.dma, DMA_MODE_WRITE);
|
||||
set_dma_addr(priv->param.dma,
|
||||
(int) priv->tx_buf[priv->tx_tail] + n);
|
||||
virt_to_bus(priv->tx_buf[priv->tx_tail]) + n);
|
||||
set_dma_count(priv->param.dma,
|
||||
priv->tx_len[priv->tx_tail] - n);
|
||||
release_dma_lock(flags);
|
||||
|
@ -1020,7 +1020,7 @@ static inline void rx_on(struct scc_priv *priv)
|
|||
flags = claim_dma_lock();
|
||||
set_dma_mode(priv->param.dma, DMA_MODE_READ);
|
||||
set_dma_addr(priv->param.dma,
|
||||
(int) priv->rx_buf[priv->rx_head]);
|
||||
virt_to_bus(priv->rx_buf[priv->rx_head]));
|
||||
set_dma_count(priv->param.dma, BUF_SIZE);
|
||||
release_dma_lock(flags);
|
||||
enable_dma(priv->param.dma);
|
||||
|
@ -1233,7 +1233,7 @@ static void special_condition(struct scc_priv *priv, int rc)
|
|||
if (priv->param.dma >= 0) {
|
||||
flags = claim_dma_lock();
|
||||
set_dma_addr(priv->param.dma,
|
||||
(int) priv->rx_buf[priv->rx_head]);
|
||||
virt_to_bus(priv->rx_buf[priv->rx_head]));
|
||||
set_dma_count(priv->param.dma, BUF_SIZE);
|
||||
release_dma_lock(flags);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue