device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all the other attributes, it is possible to switch all device driver instance to be constant. A coccinelle rule is used for this: @r_const_dev_1 disable optional_qualifier @ @@ -struct device * +const struct device * @r_const_dev_2 disable optional_qualifier @ @@ -struct device * const +const struct device * Fixes #27399 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
c8906fef79
commit
e18fcbba5a
1426 changed files with 9356 additions and 8368 deletions
|
@ -116,12 +116,15 @@ typedef union {
|
|||
* For internal use only, skip these in public documentation.
|
||||
*/
|
||||
struct audio_codec_api {
|
||||
int (*configure)(struct device *dev, struct audio_codec_cfg *cfg);
|
||||
void (*start_output)(struct device *dev);
|
||||
void (*stop_output)(struct device *dev);
|
||||
int (*set_property)(struct device *dev, audio_property_t property,
|
||||
audio_channel_t channel, audio_property_value_t val);
|
||||
int (*apply_properties)(struct device *dev);
|
||||
int (*configure)(const struct device *dev,
|
||||
struct audio_codec_cfg *cfg);
|
||||
void (*start_output)(const struct device *dev);
|
||||
void (*stop_output)(const struct device *dev);
|
||||
int (*set_property)(const struct device *dev,
|
||||
audio_property_t property,
|
||||
audio_channel_t channel,
|
||||
audio_property_value_t val);
|
||||
int (*apply_properties)(const struct device *dev);
|
||||
};
|
||||
/**
|
||||
* @endcond
|
||||
|
@ -138,8 +141,8 @@ struct audio_codec_api {
|
|||
*
|
||||
* @return 0 on success, negative error code on failure
|
||||
*/
|
||||
static inline int audio_codec_configure(struct device *dev,
|
||||
struct audio_codec_cfg *cfg)
|
||||
static inline int audio_codec_configure(const struct device *dev,
|
||||
struct audio_codec_cfg *cfg)
|
||||
{
|
||||
const struct audio_codec_api *api =
|
||||
(const struct audio_codec_api *)dev->api;
|
||||
|
@ -156,7 +159,7 @@ static inline int audio_codec_configure(struct device *dev,
|
|||
*
|
||||
* @return none
|
||||
*/
|
||||
static inline void audio_codec_start_output(struct device *dev)
|
||||
static inline void audio_codec_start_output(const struct device *dev)
|
||||
{
|
||||
const struct audio_codec_api *api =
|
||||
(const struct audio_codec_api *)dev->api;
|
||||
|
@ -173,7 +176,7 @@ static inline void audio_codec_start_output(struct device *dev)
|
|||
*
|
||||
* @return none
|
||||
*/
|
||||
static inline void audio_codec_stop_output(struct device *dev)
|
||||
static inline void audio_codec_stop_output(const struct device *dev)
|
||||
{
|
||||
const struct audio_codec_api *api =
|
||||
(const struct audio_codec_api *)dev->api;
|
||||
|
@ -193,8 +196,10 @@ static inline void audio_codec_stop_output(struct device *dev)
|
|||
*
|
||||
* @return 0 on success, negative error code on failure
|
||||
*/
|
||||
static inline int audio_codec_set_property(struct device *dev, audio_property_t property,
|
||||
audio_channel_t channel, audio_property_value_t val)
|
||||
static inline int audio_codec_set_property(const struct device *dev,
|
||||
audio_property_t property,
|
||||
audio_channel_t channel,
|
||||
audio_property_value_t val)
|
||||
{
|
||||
const struct audio_codec_api *api =
|
||||
(const struct audio_codec_api *)dev->api;
|
||||
|
@ -213,7 +218,7 @@ static inline int audio_codec_set_property(struct device *dev, audio_property_t
|
|||
*
|
||||
* @return 0 on success, negative error code on failure
|
||||
*/
|
||||
static inline int audio_codec_apply_properties(struct device *dev)
|
||||
static inline int audio_codec_apply_properties(const struct device *dev)
|
||||
{
|
||||
const struct audio_codec_api *api =
|
||||
(const struct audio_codec_api *)dev->api;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue