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

dmaengine: coh901318: fix function return types build warnings

A recent patch that removed coh901318_control() replaced it
with a number of pointers to existing functions, but those
unfortunately have the wrong return type and need to be
changed to return an 'int' with an error value rather than
a 'void' to avoid these build warnings:

drivers/dma/coh901318.c:2697:32: warning: assignment from incompatible pointer type
base->dma_slave.device_config = coh901318_dma_set_runtimeconfig;
^
drivers/dma/coh901318.c:2698:31: warning: assignment from incompatible pointer type
base->dma_slave.device_pause = coh901318_pause;
^
drivers/dma/coh901318.c:2699:32: warning: assignment from incompatible pointer type
base->dma_slave.device_resume = coh901318_resume

The coh901318_base_init function has the correct return type
already, but needs to be marked 'static' to avoid a sparse
warning about a missing declaration.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6782af118b6c ("dmaengine: coh901318: Split device_control")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Arnd Bergmann and committed by
Vinod Koul
4d76bbed 848e10bb

+12 -8
+12 -8
drivers/dma/coh901318.c
··· 1690 1690 * Pauses a transfer without losing data. Enables power save. 1691 1691 * Use this function in conjunction with coh901318_resume. 1692 1692 */ 1693 - static void coh901318_pause(struct dma_chan *chan) 1693 + static int coh901318_pause(struct dma_chan *chan) 1694 1694 { 1695 1695 u32 val; 1696 1696 unsigned long flags; ··· 1730 1730 enable_powersave(cohc); 1731 1731 1732 1732 spin_unlock_irqrestore(&cohc->lock, flags); 1733 + return 0; 1733 1734 } 1734 1735 1735 1736 /* Resumes a transfer that has been stopped via 300_dma_stop(..). 1736 1737 Power save is handled. 1737 1738 */ 1738 - static void coh901318_resume(struct dma_chan *chan) 1739 + static int coh901318_resume(struct dma_chan *chan) 1739 1740 { 1740 1741 u32 val; 1741 1742 unsigned long flags; ··· 1761 1760 } 1762 1761 1763 1762 spin_unlock_irqrestore(&cohc->lock, flags); 1763 + return 0; 1764 1764 } 1765 1765 1766 1766 bool coh901318_filter_id(struct dma_chan *chan, void *chan_id) ··· 2514 2512 }, 2515 2513 }; 2516 2514 2517 - static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan, 2518 - struct dma_slave_config *config) 2515 + static int coh901318_dma_set_runtimeconfig(struct dma_chan *chan, 2516 + struct dma_slave_config *config) 2519 2517 { 2520 2518 struct coh901318_chan *cohc = to_coh901318_chan(chan); 2521 2519 dma_addr_t addr; ··· 2535 2533 maxburst = config->dst_maxburst; 2536 2534 } else { 2537 2535 dev_err(COHC_2_DEV(cohc), "illegal channel mode\n"); 2538 - return; 2536 + return -EINVAL; 2539 2537 } 2540 2538 2541 2539 dev_dbg(COHC_2_DEV(cohc), "configure channel for %d byte transfers\n", ··· 2581 2579 default: 2582 2580 dev_err(COHC_2_DEV(cohc), 2583 2581 "bad runtimeconfig: alien address width\n"); 2584 - return; 2582 + return -EINVAL; 2585 2583 } 2586 2584 2587 2585 ctrl |= burst_sizes[i].reg; ··· 2591 2589 2592 2590 cohc->addr = addr; 2593 2591 cohc->ctrl = ctrl; 2592 + 2593 + return 0; 2594 2594 } 2595 2595 2596 - void coh901318_base_init(struct dma_device *dma, const int *pick_chans, 2597 - struct coh901318_base *base) 2596 + static void coh901318_base_init(struct dma_device *dma, const int *pick_chans, 2597 + struct coh901318_base *base) 2598 2598 { 2599 2599 int chans_i; 2600 2600 int i = 0;