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=1796388978; b=CTBY+gAhPDY7xQD0E81BZetIKM6+kJPUhC7+OFYAfrflM0dG8P5MpY+inOhVtcSuqUYt yc8GZALnvDJ1WC9TqQ1IWZ/9Tj19P8ohwl0pCgYCeyERpi+87gCU79GWMepjXQvSRYgfi EbzkPVMiIREULotfFQfhupm63uK08C19+XHmCvNMtsgyR+BZCu781jaUYNDeX1H9c0JQV DBqSB+sZDxvkcKQA7GRAd6ol2M7HbePt5nFBmuF1ESD7vbum+z79IqqqJNObdUGDCmAHx 9Wpj03/5hqkqdMRf6mexjVu+uJGGbqIzDeP46mlaEzp4x1o1jXei45i5pqrOr2Jr4HA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388978; 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=Lb7mbHmZmPuiu+f+EtbDif1JofDNFFfZoY9sbn7ihzo=; b=j/ioAOMLdphrxN+oKGJj+PzQhHbpsoifNRxH+aUcaSqMTozkN2HwUsO06CUpxWVetAxn 2MLqnLr+BLRhxYcMO8Nrh+jMP/zEfF4U7v0Zcq2X4gn2hEPH4KdUzkz9ji8tvxGgU43Hf cUXD1DgrHjZFMTnUvKrWYN+u3xOGVR0ViPlk4qPRXy1suj6XNBTw400lygtntaQORQO8l u/By0GiTL8CEwDizqB7DKcaWVz89SC12chYA+GA+5b0+mCJ9vtkRTjFVahB2FjPY/xkLd AwXkTlJQTw8hZl/fNXKBI+L9dbWnVLodXuaQuhunsa1gML+oQbiTa/Kcq/dCkIw7uBw== 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=gCrig84I; 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 55F0D606A32C; Fri, 4 Dec 2026 12:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=gCrig84I Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1FB01F00897; Fri, 4 Dec 2026 12:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388978; bh=Lb7mbHmZmPuiu+f+EtbDif1JofDNFFfZoY9sbn7ihzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gCrig84ISJmkezQZAlJ8iZ9N6kavE0MkFaev3xiJSfMduM5TD6AvU1+xPEcGwxPPV 9r/MjAGYWZvC7RntQlEcqn1RKcCRbL+5XZ9VlgskdRI25FNUT1Nrj4cquFU1mJmrG7 K6qSueL8x/5zTyZUQfKXhXy32r6CepDPVkhtV8oc= 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?= , Srinivas Pandruvada , Jonathan Cameron , Jiri Kosina , Sasha Levin Subject: [PATCH 6.1 0821/1059] HID: hid-sensor-custom: Convert to platform remove callback returning void Date: Fri, 4 Dec 2026 19:05:52 +0900 Message-ID: <20261204100705.293414545@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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 afbc301cc04f986cc54e678981bee1ca41707cf6 ] 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(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Stable-dep-of: ac6c19392c79 ("HID: sensor: custom: Fix state lifetime during removal") Signed-off-by: Sasha Levin --- drivers/hid/hid-sensor-custom.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c index 5042a70649907..63720d51f3bfa 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -944,14 +944,14 @@ static int hid_sensor_custom_probe(struct platform_device *pdev) return ret; } -static int hid_sensor_custom_remove(struct platform_device *pdev) +static void hid_sensor_custom_remove(struct platform_device *pdev) { struct hid_sensor_custom *sensor_inst = platform_get_drvdata(pdev); struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; if (sensor_inst->custom_pdev) { platform_device_unregister(sensor_inst->custom_pdev); - return 0; + return; } hid_sensor_custom_dev_if_remove(sensor_inst); @@ -967,8 +967,6 @@ static int hid_sensor_custom_remove(struct platform_device *pdev) mutex_unlock(&sensor_inst->mutex); hid_sensor_custom_remove_attributes(sensor_inst); sensor_hub_remove_callback(hsdev, hsdev->usage); - - return 0; } static const struct platform_device_id hid_sensor_custom_ids[] = { @@ -988,7 +986,7 @@ static struct platform_driver hid_sensor_custom_platform_driver = { .name = KBUILD_MODNAME, }, .probe = hid_sensor_custom_probe, - .remove = hid_sensor_custom_remove, + .remove_new = hid_sensor_custom_remove, }; module_platform_driver(hid_sensor_custom_platform_driver); -- 2.53.0