mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
ASoC: Remove 'const' from the device_node pointers
As Russell King's explained it, there should not be pointers to struct device_node: "struct device_node is a ref-counted structure. That means if you store a reference to it, you should "get" it, and you should "put" it once you've done. The act of "put"ing the pointed-to structure involves writing to that structure, so it is totally unappropriate to store a device_node structure as a const pointer. It forces you to have to cast it back to a non-const pointer at various points in time to use various OF function calls." [This isn't quite the application here, we're not geting or putting the pointer though we did add some other users who call non-const OF functions -- broonie] Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8e2be56273
commit
c362effe5c
@ -881,7 +881,7 @@ struct snd_soc_platform_driver {
|
||||
|
||||
struct snd_soc_dai_link_component {
|
||||
const char *name;
|
||||
const struct device_node *of_node;
|
||||
struct device_node *of_node;
|
||||
const char *dai_name;
|
||||
};
|
||||
|
||||
@ -983,7 +983,7 @@ struct snd_soc_codec_conf {
|
||||
* DT/OF node, but not both.
|
||||
*/
|
||||
const char *dev_name;
|
||||
const struct device_node *of_node;
|
||||
struct device_node *of_node;
|
||||
|
||||
/*
|
||||
* optional map of kcontrol, widget and path name prefixes that are
|
||||
@ -1000,7 +1000,7 @@ struct snd_soc_aux_dev {
|
||||
* DT/OF node, but not both.
|
||||
*/
|
||||
const char *codec_name;
|
||||
const struct device_node *codec_of_node;
|
||||
struct device_node *codec_of_node;
|
||||
|
||||
/* codec/machine specific init - e.g. add machine controls */
|
||||
int (*init)(struct snd_soc_component *component);
|
||||
|
Loading…
Reference in New Issue
Block a user