Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: amd: acp: rembrandt: Drop if blocks with always false condition

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>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
9ac0d69e e3a8459d

+1 -7
+1 -7
sound/soc/amd/acp/acp-rembrandt.c
··· 370 370 { 371 371 struct device *dev = &pdev->dev; 372 372 struct acp_dev_data *adata = dev_get_drvdata(dev); 373 - struct acp_chip_info *chip; 374 - 375 - chip = dev_get_platdata(&pdev->dev); 376 - if (!chip || !chip->base) { 377 - dev_err(&pdev->dev, "ACP chip data is NULL\n"); 378 - return -ENODEV; 379 - } 373 + struct acp_chip_info *chip = dev_get_platdata(dev); 380 374 381 375 rmb_acp_deinit(chip->base); 382 376