diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2017-10-04 14:15:23 +0200 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2017-10-12 18:50:51 +0200 |
commit | f47a4133ea6529ecb7ea11047a1a2fcb214e2f97 (patch) | |
tree | 3561390769ec01a0f57780954c70ed5d7cd4fffb /drivers | |
parent | dmaengine: usb-dmac: Add compatible string for r8a7743/5 (diff) | |
download | linux-f47a4133ea6529ecb7ea11047a1a2fcb214e2f97.tar.xz linux-f47a4133ea6529ecb7ea11047a1a2fcb214e2f97.zip |
dmaengine: nbpfaxi: Use of_device_get_match_data() helper
Use the of_device_get_match_data() helper instead of open coding.
Note that when used with DT, there's always a valid match.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/nbpfaxi.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index d3f918a9ee76..50559338239b 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c @@ -1286,7 +1286,6 @@ MODULE_DEVICE_TABLE(of, nbpf_match); static int nbpf_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - const struct of_device_id *of_id = of_match_device(nbpf_match, dev); struct device_node *np = dev->of_node; struct nbpf_device *nbpf; struct dma_device *dma_dev; @@ -1300,10 +1299,10 @@ static int nbpf_probe(struct platform_device *pdev) BUILD_BUG_ON(sizeof(struct nbpf_desc_page) > PAGE_SIZE); /* DT only */ - if (!np || !of_id || !of_id->data) + if (!np) return -ENODEV; - cfg = of_id->data; + cfg = of_device_get_match_data(dev); num_channels = cfg->num_channels; nbpf = devm_kzalloc(dev, sizeof(*nbpf) + num_channels * |