Skip to content

Commit 966a87b

Browse files
Peter UjfalusiVinod Koul
authored andcommitted
dmaengine: edma: Merge the of parsing functions
Instead of nesting functions just merge them since the resulting function is still small and readable. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
1 parent 56c7b74 commit 966a87b

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

drivers/dma/edma.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,31 +1921,23 @@ static int edma_xbar_event_map(struct device *dev, struct edma_soc_info *pdata,
19211921
return 0;
19221922
}
19231923

1924-
static int edma_of_parse_dt(struct device *dev, struct edma_soc_info *pdata)
1925-
{
1926-
int ret = 0;
1927-
struct property *prop;
1928-
size_t sz;
1929-
1930-
prop = of_find_property(dev->of_node, "ti,edma-xbar-event-map", &sz);
1931-
if (prop)
1932-
ret = edma_xbar_event_map(dev, pdata, sz);
1933-
1934-
return ret;
1935-
}
1936-
19371924
static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev)
19381925
{
19391926
struct edma_soc_info *info;
1927+
struct property *prop;
1928+
size_t sz;
19401929
int ret;
19411930

19421931
info = devm_kzalloc(dev, sizeof(struct edma_soc_info), GFP_KERNEL);
19431932
if (!info)
19441933
return ERR_PTR(-ENOMEM);
19451934

1946-
ret = edma_of_parse_dt(dev, info);
1947-
if (ret)
1948-
return ERR_PTR(ret);
1935+
prop = of_find_property(dev->of_node, "ti,edma-xbar-event-map", &sz);
1936+
if (prop) {
1937+
ret = edma_xbar_event_map(dev, info, sz);
1938+
if (ret)
1939+
return ERR_PTR(ret);
1940+
}
19491941

19501942
return info;
19511943
}

0 commit comments

Comments
 (0)