Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peter Ujfalusi and committed by
Vinod Koul
966a87b5 56c7b749

+8 -16
+8 -16
drivers/dma/edma.c
··· 1921 1921 return 0; 1922 1922 } 1923 1923 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 - 1937 1924 static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev) 1938 1925 { 1939 1926 struct edma_soc_info *info; 1927 + struct property *prop; 1928 + size_t sz; 1940 1929 int ret; 1941 1930 1942 1931 info = devm_kzalloc(dev, sizeof(struct edma_soc_info), GFP_KERNEL); 1943 1932 if (!info) 1944 1933 return ERR_PTR(-ENOMEM); 1945 1934 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 + } 1949 1941 1950 1942 return info; 1951 1943 }