Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f47a4133 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Vinod Koul
Browse files

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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 5543de66
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -1286,7 +1286,6 @@ MODULE_DEVICE_TABLE(of, nbpf_match);
static int nbpf_probe(struct platform_device *pdev)
static int nbpf_probe(struct platform_device *pdev)
{
{
	struct device *dev = &pdev->dev;
	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 device_node *np = dev->of_node;
	struct nbpf_device *nbpf;
	struct nbpf_device *nbpf;
	struct dma_device *dma_dev;
	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);
	BUILD_BUG_ON(sizeof(struct nbpf_desc_page) > PAGE_SIZE);


	/* DT only */
	/* DT only */
	if (!np || !of_id || !of_id->data)
	if (!np)
		return -ENODEV;
		return -ENODEV;


	cfg = of_id->data;
	cfg = of_device_get_match_data(dev);
	num_channels = cfg->num_channels;
	num_channels = cfg->num_channels;


	nbpf = devm_kzalloc(dev, sizeof(*nbpf) + num_channels *
	nbpf = devm_kzalloc(dev, sizeof(*nbpf) + num_channels *