diff mbox series

[002/173] ASoC: amd: acp: rembrandt: Drop if blocks with always false condition

Message ID 20230315150745.67084-3-u.kleine-koenig@pengutronix.de
State Accepted
Commit 9ac0d69ee5891c2d0f0425acbb13993ceef9cd12
Headers show
Series ALSA/ASoC: Convert to platform remove callback returning void | expand

Commit Message

Uwe Kleine-König March 15, 2023, 3:04 p.m. UTC
rembrandt_audio_remove() is only called after a successful call to
rembrandt_audio_probe(). With the latter it's sure that dev_get_platdata()
returns a non-NULL value and also that ->base is non-NULL. So the
corresponding check can be dropped.

While touching these lines join declaration and assignment into a single
line and make use of dev = &pdev->dev;

This prepares converting platform driver remove callbacks to return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 sound/soc/amd/acp/acp-rembrandt.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c
index 2b57c0ca4e99..15cd3f8cc82c 100644
--- a/sound/soc/amd/acp/acp-rembrandt.c
+++ b/sound/soc/amd/acp/acp-rembrandt.c
@@ -370,13 +370,7 @@  static int rembrandt_audio_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct acp_dev_data *adata = dev_get_drvdata(dev);
-	struct acp_chip_info *chip;
-
-	chip = dev_get_platdata(&pdev->dev);
-	if (!chip || !chip->base) {
-		dev_err(&pdev->dev, "ACP chip data is NULL\n");
-		return -ENODEV;
-	}
+	struct acp_chip_info *chip = dev_get_platdata(dev);
 
 	rmb_acp_deinit(chip->base);