linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Mohan Kumar <mkumard@nvidia.com>,
	Geoff Levand <geoff@infradead.org>,
	Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org,
	kernel@pengutronix.de
Subject: [PATCH 009/173] ALSA: hda/tegra: Convert to platform remove callback returning void
Date: Wed, 15 Mar 2023 16:05:01 +0100	[thread overview]
Message-ID: <20230315150745.67084-10-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de>

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 sound/pci/hda/hda_tegra.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index c2bf86781894..9d0ab043880b 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -580,12 +580,10 @@ static void hda_tegra_probe_work(struct work_struct *work)
 	return; /* no error return from async probe */
 }
 
-static int hda_tegra_remove(struct platform_device *pdev)
+static void hda_tegra_remove(struct platform_device *pdev)
 {
 	snd_card_free(dev_get_drvdata(&pdev->dev));
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static void hda_tegra_shutdown(struct platform_device *pdev)
@@ -607,7 +605,7 @@ static struct platform_driver tegra_platform_hda = {
 		.of_match_table = hda_tegra_match,
 	},
 	.probe = hda_tegra_probe,
-	.remove = hda_tegra_remove,
+	.remove_new = hda_tegra_remove,
 	.shutdown = hda_tegra_shutdown,
 };
 module_platform_driver(tegra_platform_hda);
-- 
2.39.2


  reply	other threads:[~2023-03-15 15:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 15:04 [PATCH 000/173] ALSA/ASoC: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-15 15:05 ` Uwe Kleine-König [this message]
2023-03-15 15:07 ` [PATCH 145/173] ASoC: tegra: tegra186_asrc: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 146/173] ASoC: tegra: tegra186_dspk: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 147/173] ASoC: tegra: tegra20_ac97: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 148/173] ASoC: tegra: tegra20_i2s: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 149/173] ASoC: tegra: tegra210_admaif: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 150/173] ASoC: tegra: tegra210_adx: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 151/173] ASoC: tegra: tegra210_ahub: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 152/173] ASoC: tegra: tegra210_amx: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 153/173] ASoC: tegra: tegra210_dmic: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 154/173] ASoC: tegra: tegra210_i2s: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 155/173] ASoC: tegra: tegra210_mixer: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 156/173] ASoC: tegra: tegra210_mvc: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 157/173] ASoC: tegra: tegra210_ope: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 158/173] ASoC: tegra: tegra210_sfc: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 159/173] ASoC: tegra: tegra30_ahub: " Uwe Kleine-König
2023-03-15 15:07 ` [PATCH 160/173] ASoC: tegra: tegra30_i2s: " Uwe Kleine-König
2023-03-16  9:32 ` [PATCH 000/173] ALSA/ASoC: " Takashi Iwai
2023-03-21 16:50 ` (subset) " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230315150745.67084-10-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=geoff@infradead.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkumard@nvidia.com \
    --cc=o-takashi@sakamocchi.jp \
    --cc=perex@perex.cz \
    --cc=thierry.reding@gmail.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).