[PATCH] ASoC: fsl_spdif: Fix unnecessary check in fsl_spdif_probe()

Subsystems: freescale soc sound drivers, sound, sound - soc layer / dynamic audio power management (asoc), the rest

STALE2135d LANDED

Landed in mainline as 601fd3a7d849 on 2020-10-01.

4 messages, 2 authors, 2020-10-01 · open the first message on its own page

[PATCH] ASoC: fsl_spdif: Fix unnecessary check in fsl_spdif_probe()

From: Tang Bin <hidden>
Date: 2020-08-26 15:09:03

The function fsl_spdif_probe() is only called with an openfirmware
platform device. Therefore there is no need to check that the passed
in device is NULL.

Signed-off-by: Zhang Shengju <redacted>
Signed-off-by: Tang Bin <redacted>
---
 sound/soc/fsl/fsl_spdif.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 7858a5499..395c50167 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -1221,9 +1221,6 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 	void __iomem *regs;
 	int irq, ret, i;
 
-	if (!np)
-		return -ENODEV;
-
 	spdif_priv = devm_kzalloc(&pdev->dev, sizeof(*spdif_priv), GFP_KERNEL);
 	if (!spdif_priv)
 		return -ENOMEM;
-- 
2.20.1.windows.1


Re: [PATCH] ASoC: fsl_spdif: Fix unnecessary check in fsl_spdif_probe()

From: Mark Brown <broonie@kernel.org>
Date: 2020-08-26 16:53:49

On Wed, Aug 26, 2020 at 11:09:18PM +0800, Tang Bin wrote:
The function fsl_spdif_probe() is only called with an openfirmware
platform device. Therefore there is no need to check that the passed
in device is NULL.
Why is this an issue - the check will make things more robust if someone
manages to load the driver on a non-DT system and otherwise costs us a
couple of instructions?

Re: [PATCH] ASoC: fsl_spdif: Fix unnecessary check infsl_spdif_probe()

From: Tang Bin <hidden>
Date: 2020-08-27 01:38:38

Hi Mark

在 2020/8/27 0:53, Mark Brown 写道:
On Wed, Aug 26, 2020 at 11:09:18PM +0800, Tang Bin wrote:
quoted
The function fsl_spdif_probe() is only called with an openfirmware
platform device. Therefore there is no need to check that the passed
in device is NULL.
Why is this an issue - the check will make things more robust if someone
manages to load the driver on a non-DT system and otherwise costs us a
couple of instructions?
Thanks for your reply.

In this function,  function fsl_spdif_probe() can be triggered only if 
the platform_device and platform_driver matches,

so I think the judgement at the beginning is redundant.

Thanks

Tang Bin


Re: [PATCH] ASoC: fsl_spdif: Fix unnecessary check in fsl_spdif_probe()

From: Mark Brown <broonie@kernel.org>
Date: 2020-10-01 22:47:21

On Wed, 26 Aug 2020 23:09:18 +0800, Tang Bin wrote:
The function fsl_spdif_probe() is only called with an openfirmware
platform device. Therefore there is no need to check that the passed
in device is NULL.
Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl_spdif: Fix unnecessary check in fsl_spdif_probe()
      commit: 601fd3a7d849cf8a5dbd3628b3c29af9e5377961

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help