diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-10-16 03:18:07 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-10-26 21:22:45 -0400 |
commit | 966a87b5962ed0d058e93809ae310fa542a69c8e (patch) | |
tree | a4e83497fefd82f989bead7a977a39bb65dbcd10 | |
parent | 56c7b749965947af45efaf8a7021a1f86d4ce4d8 (diff) |
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>
-rw-r--r-- | drivers/dma/edma.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index c1b8bb09c221..d4d71e60da1b 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
@@ -1921,31 +1921,23 @@ static int edma_xbar_event_map(struct device *dev, struct edma_soc_info *pdata, | |||
1921 | return 0; | 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 | static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev) | 1924 | static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev) |
1938 | { | 1925 | { |
1939 | struct edma_soc_info *info; | 1926 | struct edma_soc_info *info; |
1927 | struct property *prop; | ||
1928 | size_t sz; | ||
1940 | int ret; | 1929 | int ret; |
1941 | 1930 | ||
1942 | info = devm_kzalloc(dev, sizeof(struct edma_soc_info), GFP_KERNEL); | 1931 | info = devm_kzalloc(dev, sizeof(struct edma_soc_info), GFP_KERNEL); |
1943 | if (!info) | 1932 | if (!info) |
1944 | return ERR_PTR(-ENOMEM); | 1933 | return ERR_PTR(-ENOMEM); |
1945 | 1934 | ||
1946 | ret = edma_of_parse_dt(dev, info); | 1935 | prop = of_find_property(dev->of_node, "ti,edma-xbar-event-map", &sz); |
1947 | if (ret) | 1936 | if (prop) { |
1948 | return ERR_PTR(ret); | 1937 | ret = edma_xbar_event_map(dev, info, sz); |
1938 | if (ret) | ||
1939 | return ERR_PTR(ret); | ||
1940 | } | ||
1949 | 1941 | ||
1950 | return info; | 1942 | return info; |
1951 | } | 1943 | } |