提交 a53e28da 编写于 作者: L Lars-Peter Clausen 提交者: Vinod Koul

dma: Make the 'mask' parameter of __dma_request_channel const

The 'mask' parameter is not modified in __dma_request_channel and really
shouldn't be. Make this explicit by making the parameter const.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 a7e34065
...@@ -174,7 +174,8 @@ static struct class dma_devclass = { ...@@ -174,7 +174,8 @@ static struct class dma_devclass = {
#define dma_device_satisfies_mask(device, mask) \ #define dma_device_satisfies_mask(device, mask) \
__dma_device_satisfies_mask((device), &(mask)) __dma_device_satisfies_mask((device), &(mask))
static int static int
__dma_device_satisfies_mask(struct dma_device *device, dma_cap_mask_t *want) __dma_device_satisfies_mask(struct dma_device *device,
const dma_cap_mask_t *want)
{ {
dma_cap_mask_t has; dma_cap_mask_t has;
...@@ -463,7 +464,8 @@ static void dma_channel_rebalance(void) ...@@ -463,7 +464,8 @@ static void dma_channel_rebalance(void)
} }
} }
static struct dma_chan *private_candidate(dma_cap_mask_t *mask, struct dma_device *dev, static struct dma_chan *private_candidate(const dma_cap_mask_t *mask,
struct dma_device *dev,
dma_filter_fn fn, void *fn_param) dma_filter_fn fn, void *fn_param)
{ {
struct dma_chan *chan; struct dma_chan *chan;
...@@ -505,7 +507,8 @@ static struct dma_chan *private_candidate(dma_cap_mask_t *mask, struct dma_devic ...@@ -505,7 +507,8 @@ static struct dma_chan *private_candidate(dma_cap_mask_t *mask, struct dma_devic
* @fn: optional callback to disposition available channels * @fn: optional callback to disposition available channels
* @fn_param: opaque parameter to pass to dma_filter_fn * @fn_param: opaque parameter to pass to dma_filter_fn
*/ */
struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param) struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
dma_filter_fn fn, void *fn_param)
{ {
struct dma_device *device, *_d; struct dma_device *device, *_d;
struct dma_chan *chan = NULL; struct dma_chan *chan = NULL;
......
...@@ -967,7 +967,8 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); ...@@ -967,7 +967,8 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
#ifdef CONFIG_DMA_ENGINE #ifdef CONFIG_DMA_ENGINE
enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
void dma_issue_pending_all(void); void dma_issue_pending_all(void);
struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
dma_filter_fn fn, void *fn_param);
struct dma_chan *dma_request_slave_channel(struct device *dev, char *name); struct dma_chan *dma_request_slave_channel(struct device *dev, char *name);
void dma_release_channel(struct dma_chan *chan); void dma_release_channel(struct dma_chan *chan);
#else #else
...@@ -978,7 +979,7 @@ static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descript ...@@ -978,7 +979,7 @@ static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descript
static inline void dma_issue_pending_all(void) static inline void dma_issue_pending_all(void)
{ {
} }
static inline struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
dma_filter_fn fn, void *fn_param) dma_filter_fn fn, void *fn_param)
{ {
return NULL; return NULL;
...@@ -1005,9 +1006,9 @@ struct dma_chan *net_dma_find_channel(void); ...@@ -1005,9 +1006,9 @@ struct dma_chan *net_dma_find_channel(void);
__dma_request_slave_channel_compat(&(mask), x, y, dev, name) __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
static inline struct dma_chan static inline struct dma_chan
*__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn, *__dma_request_slave_channel_compat(const dma_cap_mask_t *mask,
void *fn_param, struct device *dev, dma_filter_fn fn, void *fn_param,
char *name) struct device *dev, char *name)
{ {
struct dma_chan *chan; struct dma_chan *chan;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册