Skip to content

Commit a8271d7

Browse files
YongWu-HFgregkh
authored andcommitted
ASoC: codecs: wcd938x: Make use of the helper component_compare/release_of
Use the common compare/release helpers from component. Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Srinivas Kandagatla <[email protected]> Cc: Pierre-Louis Bossart <[email protected]> Cc: [email protected] Signed-off-by: Yong Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4811a48 commit a8271d7

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

sound/soc/codecs/wcd938x.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4417,16 +4417,6 @@ static const struct component_master_ops wcd938x_comp_ops = {
44174417
.unbind = wcd938x_unbind,
44184418
};
44194419

4420-
static int wcd938x_compare_of(struct device *dev, void *data)
4421-
{
4422-
return dev->of_node == data;
4423-
}
4424-
4425-
static void wcd938x_release_of(struct device *dev, void *data)
4426-
{
4427-
of_node_put(data);
4428-
}
4429-
44304420
static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
44314421
struct device *dev,
44324422
struct component_match **matchptr)
@@ -4442,17 +4432,17 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
44424432
}
44434433

44444434
of_node_get(wcd938x->rxnode);
4445-
component_match_add_release(dev, matchptr, wcd938x_release_of,
4446-
wcd938x_compare_of, wcd938x->rxnode);
4435+
component_match_add_release(dev, matchptr, component_release_of,
4436+
component_compare_of, wcd938x->rxnode);
44474437

44484438
wcd938x->txnode = of_parse_phandle(np, "qcom,tx-device", 0);
44494439
if (!wcd938x->txnode) {
44504440
dev_err(dev, "%s: Tx-device node not defined\n", __func__);
44514441
return -ENODEV;
44524442
}
44534443
of_node_get(wcd938x->txnode);
4454-
component_match_add_release(dev, matchptr, wcd938x_release_of,
4455-
wcd938x_compare_of, wcd938x->txnode);
4444+
component_match_add_release(dev, matchptr, component_release_of,
4445+
component_compare_of, wcd938x->txnode);
44564446
return 0;
44574447
}
44584448

0 commit comments

Comments
 (0)