mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 05:27:07 +02:00
ASoC: eureka-tlv320: Hold reference returned from of_find_xxx API
[ Upstream commitbfb735a3ce] In eukrea_tlv320_probe(), we need to hold the reference returned from of_find_compatible_node() which has increased the refcount and then call of_node_put() with it when done. Fixes:66f232908d("ASoC: eukrea-tlv320: Add DT support.") Co-authored-by: Kelin Wang <wangkelin2023@163.com> Signed-off-by: Liang He <windhl@126.com> Link: https://lore.kernel.org/r/20220914134354.3995587-1-windhl@126.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ad0b8ed172
commit
a9a60d6405
|
|
@ -86,7 +86,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
|
||||||
int ret;
|
int ret;
|
||||||
int int_port = 0, ext_port;
|
int int_port = 0, ext_port;
|
||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
struct device_node *ssi_np = NULL, *codec_np = NULL;
|
struct device_node *ssi_np = NULL, *codec_np = NULL, *tmp_np = NULL;
|
||||||
|
|
||||||
eukrea_tlv320.dev = &pdev->dev;
|
eukrea_tlv320.dev = &pdev->dev;
|
||||||
if (np) {
|
if (np) {
|
||||||
|
|
@ -143,7 +143,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (machine_is_eukrea_cpuimx27() ||
|
if (machine_is_eukrea_cpuimx27() ||
|
||||||
of_find_compatible_node(NULL, NULL, "fsl,imx21-audmux")) {
|
(tmp_np = of_find_compatible_node(NULL, NULL, "fsl,imx21-audmux"))) {
|
||||||
imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
|
imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
|
||||||
IMX_AUDMUX_V1_PCR_SYN |
|
IMX_AUDMUX_V1_PCR_SYN |
|
||||||
IMX_AUDMUX_V1_PCR_TFSDIR |
|
IMX_AUDMUX_V1_PCR_TFSDIR |
|
||||||
|
|
@ -158,10 +158,11 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
|
||||||
IMX_AUDMUX_V1_PCR_SYN |
|
IMX_AUDMUX_V1_PCR_SYN |
|
||||||
IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0)
|
IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0)
|
||||||
);
|
);
|
||||||
|
of_node_put(tmp_np);
|
||||||
} else if (machine_is_eukrea_cpuimx25sd() ||
|
} else if (machine_is_eukrea_cpuimx25sd() ||
|
||||||
machine_is_eukrea_cpuimx35sd() ||
|
machine_is_eukrea_cpuimx35sd() ||
|
||||||
machine_is_eukrea_cpuimx51sd() ||
|
machine_is_eukrea_cpuimx51sd() ||
|
||||||
of_find_compatible_node(NULL, NULL, "fsl,imx31-audmux")) {
|
(tmp_np = of_find_compatible_node(NULL, NULL, "fsl,imx31-audmux"))) {
|
||||||
if (!np)
|
if (!np)
|
||||||
ext_port = machine_is_eukrea_cpuimx25sd() ?
|
ext_port = machine_is_eukrea_cpuimx25sd() ?
|
||||||
4 : 3;
|
4 : 3;
|
||||||
|
|
@ -178,6 +179,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
|
||||||
IMX_AUDMUX_V2_PTCR_SYN,
|
IMX_AUDMUX_V2_PTCR_SYN,
|
||||||
IMX_AUDMUX_V2_PDCR_RXDSEL(int_port)
|
IMX_AUDMUX_V2_PDCR_RXDSEL(int_port)
|
||||||
);
|
);
|
||||||
|
of_node_put(tmp_np);
|
||||||
} else {
|
} else {
|
||||||
if (np) {
|
if (np) {
|
||||||
/* The eukrea,asoc-tlv320 driver was explicitly
|
/* The eukrea,asoc-tlv320 driver was explicitly
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user