From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79DE44D90AC for ; Wed, 13 May 2026 18:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778695725; cv=none; b=bC051g3nEVW5VUrnEd4BzseR/zNThIJCPrYp7xEjqtwfvJzWbUsix9XHdi5jVpQrEKOc21Ir2jtkB6gD3w8QxaHrYJ/Ox61Eka+cH+npRFSQmprqjHUoc0vu+cnCU4KAZ2tPLhUFLHvdxPQDStNJ/b4hMqPNfs2tZ7ylMvSgHT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778695725; c=relaxed/simple; bh=Eak+LRcuLodhpgO5QB1akqS2RAA8hOef2bCUMTopUX4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=twhlfR6yHV/dBU70ULKD7KcYQLr8bkaL+J+lnbA2RZIyLIoFOGnliTcRd8wOU2ayAFo6txO+gwMhXTa8/LRXemce1c/qCoTYR5VMOQChp2MMRX0lF9WcnfJRtx+PdvFbY69Bg+bQr5DXAH+6tgDSLRAl+p3hY5e9A4kRGSi2lm8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NgWD6Bct; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NgWD6Bct" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B383C19425; Wed, 13 May 2026 18:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778695725; bh=Eak+LRcuLodhpgO5QB1akqS2RAA8hOef2bCUMTopUX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NgWD6BctxOt5Zr3BBDyyIR8MoYXhByIuj8SLjZjzKzArURJhM2dexpYBTA7wVEeXq r2ANgIzPxtAUjPfRJwJVQOz1ZlZ5F/CXLmy9uKsYsZzbf3NSZd9Bhn8aMJvaU/qkga Wnw8WmMhnOSNtCGGRo1hAfnqTTknEqayKQ6EOFZqaf8D+ILXq7X/+x6I8XwBu0GILv y1XX5Nq/abBH9xrNDsEw+HXoZ1njGgzGq6wpl6m5EP2renFSPXiuyrJVoNX8n0aJrb paOT0WxMCRYLfMnJv7Y2UMFOVDPzt1MPEaMcDTGniTXUq2f5imAwaaN2lW7Pubw3/K 6dWdysQJXp/lg== From: Sasha Levin To: stable@vger.kernel.org Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Mark Brown , Sasha Levin Subject: [PATCH 6.6.y 1/3] spi: spi-ti-qspi: Convert to platform remove callback returning void Date: Wed, 13 May 2026 14:08:40 -0400 Message-ID: <20260513180842.3912849-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051215-earache-outdated-a817@gregkh> References: <2026051215-earache-outdated-a817@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Uwe Kleine-König [ Upstream commit 2f2802d1a59d79a3d00cb429841db502c2bbc3df ] 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Add an error message to the error path that returned an error before to replace the core's error message with more information. Apart from the different wording of the error message, this patch doesn't introduce a semantic difference. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231105172649.3738556-2-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown Stable-dep-of: 0c18a1bacbb1 ("spi: ti-qspi: fix controller deregistration") Signed-off-by: Sasha Levin --- drivers/spi/spi-ti-qspi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 4c81516b67db5..fdc092a05284a 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -907,21 +907,22 @@ static int ti_qspi_probe(struct platform_device *pdev) return ret; } -static int ti_qspi_remove(struct platform_device *pdev) +static void ti_qspi_remove(struct platform_device *pdev) { struct ti_qspi *qspi = platform_get_drvdata(pdev); int rc; rc = spi_master_suspend(qspi->master); - if (rc) - return rc; + if (rc) { + dev_alert(&pdev->dev, "spi_master_suspend() failed (%pe)\n", + ERR_PTR(rc)); + return; + } pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); ti_qspi_dma_cleanup(qspi); - - return 0; } static const struct dev_pm_ops ti_qspi_pm_ops = { @@ -930,7 +931,7 @@ static const struct dev_pm_ops ti_qspi_pm_ops = { static struct platform_driver ti_qspi_driver = { .probe = ti_qspi_probe, - .remove = ti_qspi_remove, + .remove_new = ti_qspi_remove, .driver = { .name = "ti-qspi", .pm = &ti_qspi_pm_ops, -- 2.53.0