Skip to content

Commit

Permalink
ASoC: simple-card: Remove useless casts
Browse files Browse the repository at this point in the history
There is no need to cast the cpu_of_node or codec_of_node of the
dai_links when calling of_put_node.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Jean-Francois Moine authored and Mark Brown committed Nov 10, 2014
1 parent 4476159 commit 0099c76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
7 changes: 2 additions & 5 deletions sound/soc/generic/simple-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,13 @@ static int asoc_simple_card_unref(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
struct snd_soc_dai_link *dai_link;
struct device_node *np;
int num_links;

for (num_links = 0, dai_link = card->dai_link;
num_links < card->num_links;
num_links++, dai_link++) {
np = (struct device_node *) dai_link->cpu_of_node;
of_node_put(np);
np = (struct device_node *) dai_link->codec_of_node;
of_node_put(np);
of_node_put(dai_link->cpu_of_node);
of_node_put(dai_link->codec_of_node);
}
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/samsung/odroidx2_max98090.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ static int odroidx2_audio_remove(struct platform_device *pdev)

snd_soc_unregister_card(card);

of_node_put((struct device_node *)odroidx2_dai[0].cpu_of_node);
of_node_put((struct device_node *)odroidx2_dai[0].codec_of_node);
of_node_put(odroidx2_dai[0].cpu_of_node);
of_node_put(odroidx2_dai[0].codec_of_node);

return 0;
}
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/ux500/mop500.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ static void mop500_of_node_put(void)

for (i = 0; i < 2; i++) {
if (mop500_dai_links[i].cpu_of_node)
of_node_put((struct device_node *)
mop500_dai_links[i].cpu_of_node);
of_node_put(mop500_dai_links[i].cpu_of_node);
if (mop500_dai_links[i].codec_of_node)
of_node_put((struct device_node *)
mop500_dai_links[i].codec_of_node);
of_node_put(mop500_dai_links[i].codec_of_node);
}
}

Expand Down

0 comments on commit 0099c76

Please sign in to comment.