From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793213033; b=PhYXtGt0ewkIaweykn6233OMJzjE6ZL5QnTEAmvtMOeUqPmMBuPGXmnzOp2r/U8zZrW8 I9ObmEEUdWosAYTj0B2X4zt8jxALS+rZLLwTr9fLHE4EVN2NaNRn+1wLE3GWMpRZIlkav p3D25kPwKf19KRuzF7lzH958Avgl/QjduMALE6OkeQBPnov5NRHIoznRpAUn1hOooumFy koUV7OV1NPoX9+WzFvs9PX4Wut7n0DMUBMdkBiJzyLIA0oAMwLjowSVfZEeKuYX4Cz97S eD4ZMBPWXddyhYQfcPxWU/Kybjqf2ezZeZC2+wk4n/+4u66xXjxPAizWYWyg9goz9Bg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793213033; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=Mg9NuGcYAlm54n9DB/lkZn0vZDfwf+Znyx4DfySVnwQ=; b=1BXHUmtus8HPxX+dfqK2RgkOwfFldroIAm+B7n8SZ6X1dKb/NacxzjLbcCe/6dcVUmx4 UPkIGrkXeTPgYh2YeaeAGawCaQUzcD8dT4WtO3n9xamurehXWHNwB49udZf97wD7xVJNM nI++sv1eF4QP6iDHaf1G9eY7gbh9H2Hgrcb0kHwmHyD2eaLGNm2O2upR9kFMfWZ7fUg0p XAXyLJ9AChtTZQb5S1BD5kT3biHGzVdQiMIk0w9Udk5SCP4jC7zH7xlSpXSOvQwMc+cH8 7xJidiE00u5hCsu1ZsQF9XhVVR7jMKN4b8lywSpaR7Mz01BS6e1mHUdkLF+jKEuKTtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="Ynho/DhD"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02BAA606A31D; Wed, 28 Oct 2026 18:43:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Ynho/DhD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 530791F01825; Wed, 28 Oct 2026 18:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793213032; bh=Mg9NuGcYAlm54n9DB/lkZn0vZDfwf+Znyx4DfySVnwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ynho/DhD4HhkVWUhsc3qRBcwucnefifosHhm14edQ/0Y7HXnbTV7nIEVzNYlqmeWt Q/FIZOejoRsQ+LuIfuBFaOMVkDpMDiNK5RqOiMK3NJASrPg9pFljPEUwBBGFW1f7d+ 2AdREZZnFwTih2KyPF4uO3FBpJ8aFXSSFOcbwDxY= 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?= , Sasha Levin Subject: [PATCH 6.1 0363/1887] usb: gadget: at91_udc: Convert to platform remove callback returning void Date: Wed, 28 Oct 2026 17:40:59 +0100 Message-ID: <20261028170507.493644108@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261028170459.200466217@linuxfoundation.org> References: <20261028170459.200466217@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Uwe Kleine-König [ Upstream commit cbd1b152519a581bfe14fb6b14ea6e57cca426c1 ] 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(). In the error path emit an error message replacing the (less useful) message by the core. Apart from the improved error message there is no change in behaviour. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231120215830.71071-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman Stable-dep-of: c27d13ce4bab ("usb: gadget: at91_udc: drain polled-VBUS timer/work before udc is freed") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/at91_udc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c @@ -1927,7 +1927,7 @@ err_unprepare_fclk: return retval; } -static int at91udc_remove(struct platform_device *pdev) +static void at91udc_remove(struct platform_device *pdev) { struct at91_udc *udc = platform_get_drvdata(pdev); unsigned long flags; @@ -1935,8 +1935,11 @@ static int at91udc_remove(struct platfor DBG("remove\n"); usb_del_gadget_udc(&udc->gadget); - if (udc->driver) - return -EBUSY; + if (udc->driver) { + dev_err(&pdev->dev, + "Driver still in use but removing anyhow\n"); + return; + } spin_lock_irqsave(&udc->lock, flags); pullup(udc, 0); @@ -1946,8 +1949,6 @@ static int at91udc_remove(struct platfor remove_debug_file(udc); clk_unprepare(udc->fclk); clk_unprepare(udc->iclk); - - return 0; } #ifdef CONFIG_PM @@ -2003,7 +2004,7 @@ static int at91udc_resume(struct platfor #endif static struct platform_driver at91_udc_driver = { - .remove = at91udc_remove, + .remove_new = at91udc_remove, .shutdown = at91udc_shutdown, .suspend = at91udc_suspend, .resume = at91udc_resume,