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=1796386298; b=Gug/keb7KIlxBslXuuWPiJY9C+iJTe5JVPzkQ0bhDky3qh/0iqdtVb6ZKE7uH99Z/0GO qtVN0CZmVbARA7yxhl/slI44e5hWHeJwDohP9bYqb5njXf/M9XQbqmGnWTLlpGkNs0/3B qrBd4C8t6jw7/iYjR1D2r2o31jh5jdPqnwcwKoBu50uvfz1pG9K9leylwHxFrCQKls2B1 Ms+INFFVUJXvaHf7FTKMu6CR8K8giym66mIsKqaVjQypQgxhooEO3492CU52m2KJhuajG u/eze0Que43d9IpIFIk0hjDpwvkmBDQT8npyAu+FhH0yxyCgxpUvtq1RJf6e9MBA7gQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386298; 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=jFaDuh+1wdwrQsCM+djNAht5+7VtF9th1s6RNFu8VGw=; b=acYoGdhriYTF8UaCqEM/thkWQ8vJBNYkbAEXz8X4l8xJMdPwGusIe2KzOrAEstFcGiGF H7OjTzS0BtNuoTa6+A+8r1n/1FIYXbgAHe/RPEEJFpzvgvIbOcnwQlpsxtjiEQw5No8AL U60rR2uCvHYnpSmhG7KQI8VCSwK3myJSVpmEHH2BUzqcL/7+Q5Hc8jJnVSE6hr6QLaRxO X1JEVZDg+A4w/7OpZvJwAYcFlh/DPOph8YoarYY+DJPh7VTrCwTxDslX79mlLBqPf3mSL v86Gwz5vWYY33RMc9tnfy7bPjdllfjgyIsEAcJMu1I4OR9rLuidNE6orYr3ycd38ulA== 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=Wp7PCC3q; 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 DEF57606A322; Fri, 4 Dec 2026 12:11:38 +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=Wp7PCC3q Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43C1C1F000CE; Fri, 4 Dec 2026 12:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386298; bh=jFaDuh+1wdwrQsCM+djNAht5+7VtF9th1s6RNFu8VGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Wp7PCC3q1CNOlNsYoPgjhy6dFK6MrR3xJ8qAnQ6dt9lcJPDuWhn/5fELBaOnvA+oz F+pEnDRM8k+W9Fq77wazQsAqdGCcMPyGc/0ATf4M7EjI77zafyLF1CDT54KRurGGRU SsPTBwh1pZWeThJPMLhnP8Q+Ofo9Y12er5S1/jcQ= 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.6 0905/1167] HID: hid-sensor-custom: Convert to platform remove callback returning void Date: Fri, 4 Dec 2026 19:05:32 +0900 Message-ID: <20261204100725.776287704@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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 7cd85fc8f2d3e..bbbc10d5a5838 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -1040,14 +1040,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); @@ -1063,8 +1063,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[] = { @@ -1084,7 +1082,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