[PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in the probe function

Tang Bin tangbin at cmss.chinamobile.com
Wed Aug 11 04:55:23 PDT 2021


The function stm32_spdifrx_parse_of() is only called by the function
stm32_spdifrx_probe(), and the probe function is only called with
an openfirmware platform device. Therefore there is no need to check
the device_node in probe function.

Signed-off-by: Zhang Shengju <zhangshengju at cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin at cmss.chinamobile.com>
---
 sound/soc/stm/stm32_spdifrx.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index 48145f553..8fe822903 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -908,13 +908,9 @@ static const struct of_device_id stm32_spdifrx_ids[] = {
 static int stm32_spdifrx_parse_of(struct platform_device *pdev,
 				  struct stm32_spdifrx_data *spdifrx)
 {
-	struct device_node *np = pdev->dev.of_node;
 	const struct of_device_id *of_id;
 	struct resource *res;
 
-	if (!np)
-		return -ENODEV;
-
 	of_id = of_match_device(stm32_spdifrx_ids, &pdev->dev);
 	if (of_id)
 		spdifrx->regmap_conf =
-- 
2.20.1.windows.1






More information about the linux-arm-kernel mailing list