diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-04-15 11:13:35 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-05-02 11:49:07 -0400 |
commit | 593d9c2e10bc66f1c5cf1adb5eeb709432eb616d (patch) | |
tree | ae663809b01d865620daea0870a6a43e5e6b236a /drivers/dma | |
parent | a2a7c176cc4ae48ec1589429ef12b89975963b48 (diff) |
dma: mmp_pdma: Fix physical channel memory allocation size
Use sizeof(*var) instead of sizeof(type) when calling devm_k*alloc().
This avoids using the wrong type as was done to allocate the physical
channels array.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/mmp_pdma.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index f3fe92da295f..7affa533d2a8 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c | |||
@@ -858,8 +858,7 @@ static int mmp_pdma_chan_init(struct mmp_pdma_device *pdev, int idx, int irq) | |||
858 | struct mmp_pdma_chan *chan; | 858 | struct mmp_pdma_chan *chan; |
859 | int ret; | 859 | int ret; |
860 | 860 | ||
861 | chan = devm_kzalloc(pdev->dev, sizeof(struct mmp_pdma_chan), | 861 | chan = devm_kzalloc(pdev->dev, sizeof(*chan), GFP_KERNEL); |
862 | GFP_KERNEL); | ||
863 | if (chan == NULL) | 862 | if (chan == NULL) |
864 | return -ENOMEM; | 863 | return -ENOMEM; |
865 | 864 | ||
@@ -946,8 +945,7 @@ static int mmp_pdma_probe(struct platform_device *op) | |||
946 | irq_num++; | 945 | irq_num++; |
947 | } | 946 | } |
948 | 947 | ||
949 | pdev->phy = devm_kcalloc(pdev->dev, | 948 | pdev->phy = devm_kcalloc(pdev->dev, dma_channels, sizeof(*pdev->phy), |
950 | dma_channels, sizeof(struct mmp_pdma_chan), | ||
951 | GFP_KERNEL); | 949 | GFP_KERNEL); |
952 | if (pdev->phy == NULL) | 950 | if (pdev->phy == NULL) |
953 | return -ENOMEM; | 951 | return -ENOMEM; |