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 00AD33C9896; Fri, 15 May 2026 16:16:31 +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=1778861791; cv=none; b=s6+dmmdP7M18/ggnIwGSO2XPr0/W/ABIZTpaEdOCTE9a66xewxGGrhxRWZBCetZEYBEe/8i+X32MfOaDQYPEApxQjjepOIPIllSCSvtOsgtumHEr1IQU+XZpEkaW6ddOVw9yEPcIESE59q7Xzr97n2IEp2r4R3/PMuRi5kRSOg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861791; c=relaxed/simple; bh=WVrYicOAfKA5JYnAcyJYUwdaqqip5gyKPADwrtRW7eo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iE8iTXeb5n1PQNDPeMxbZqo7kMAWdJ3ktatnhVqBMXVATjpQny8e5NC/kW41q8oHsRqFTIg5tm2fJC9NHfGpKSzCGTpCO3VK02ytChJTa0mDIQrS36p3+HEo3TXD6ijK3Jk/pV/Auq4v8jg9QlYDm1o4pkBx0etnUBd06e2EKHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FlgvESJ/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FlgvESJ/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AC81C2BCB0; Fri, 15 May 2026 16:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778861790; bh=WVrYicOAfKA5JYnAcyJYUwdaqqip5gyKPADwrtRW7eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FlgvESJ/V7BISJp6j76Orm666YTMmQu8hikfTgNGxxvaZyneZWXdxnQto9cgmcXi5 h3Ky+tMzdLAlziSHtDdjF0btSNbVPOe78W9gNdplIF/9pokgKvVAeP1nbzVUlpBNKt 1ZfKGDeq974F9IHHxnt7aW1ZlKFjLoVF4Alm8Izc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Mark Brown , Sasha Levin Subject: [PATCH 6.6 427/474] spi: spi-ti-qspi: Convert to platform remove callback returning void Date: Fri, 15 May 2026 17:48:56 +0200 Message-ID: <20260515154724.307390435@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore 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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-ti-qspi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -907,21 +907,22 @@ free_master: 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_p 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,