diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-cpm.c')
-rw-r--r-- | drivers/i2c/busses/i2c-cpm.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index 3fcf78e906db..b5db8b883615 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c | |||
@@ -531,16 +531,16 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
531 | rbdf = cpm->rbase; | 531 | rbdf = cpm->rbase; |
532 | 532 | ||
533 | for (i = 0; i < CPM_MAXBD; i++) { | 533 | for (i = 0; i < CPM_MAXBD; i++) { |
534 | cpm->rxbuf[i] = dma_alloc_coherent( | 534 | cpm->rxbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev, |
535 | NULL, CPM_MAX_READ + 1, &cpm->rxdma[i], GFP_KERNEL); | 535 | CPM_MAX_READ + 1, |
536 | &cpm->rxdma[i], GFP_KERNEL); | ||
536 | if (!cpm->rxbuf[i]) { | 537 | if (!cpm->rxbuf[i]) { |
537 | ret = -ENOMEM; | 538 | ret = -ENOMEM; |
538 | goto out_muram; | 539 | goto out_muram; |
539 | } | 540 | } |
540 | out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1)); | 541 | out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1)); |
541 | 542 | ||
542 | cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent( | 543 | cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL); |
543 | NULL, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL); | ||
544 | if (!cpm->txbuf[i]) { | 544 | if (!cpm->txbuf[i]) { |
545 | ret = -ENOMEM; | 545 | ret = -ENOMEM; |
546 | goto out_muram; | 546 | goto out_muram; |
@@ -585,10 +585,10 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
585 | out_muram: | 585 | out_muram: |
586 | for (i = 0; i < CPM_MAXBD; i++) { | 586 | for (i = 0; i < CPM_MAXBD; i++) { |
587 | if (cpm->rxbuf[i]) | 587 | if (cpm->rxbuf[i]) |
588 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 588 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
589 | cpm->rxbuf[i], cpm->rxdma[i]); | 589 | cpm->rxbuf[i], cpm->rxdma[i]); |
590 | if (cpm->txbuf[i]) | 590 | if (cpm->txbuf[i]) |
591 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 591 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
592 | cpm->txbuf[i], cpm->txdma[i]); | 592 | cpm->txbuf[i], cpm->txdma[i]); |
593 | } | 593 | } |
594 | cpm_muram_free(cpm->dp_addr); | 594 | cpm_muram_free(cpm->dp_addr); |
@@ -619,9 +619,9 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm) | |||
619 | 619 | ||
620 | /* Free all memory */ | 620 | /* Free all memory */ |
621 | for (i = 0; i < CPM_MAXBD; i++) { | 621 | for (i = 0; i < CPM_MAXBD; i++) { |
622 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 622 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
623 | cpm->rxbuf[i], cpm->rxdma[i]); | 623 | cpm->rxbuf[i], cpm->rxdma[i]); |
624 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 624 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
625 | cpm->txbuf[i], cpm->txdma[i]); | 625 | cpm->txbuf[i], cpm->txdma[i]); |
626 | } | 626 | } |
627 | 627 | ||