🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11634

[PATCH 01/17] Input: gameport - attach manual drivers through the driver core

#11634
From: Leon Romanovsky
Date: Thu, 05 Nov 2026 11:42
50 lines
9525 bytes
From: Leon Romanovsky <leonro@nvidia.com>

Manual gameport binding calls connect before publishing the binding, so
driver-core admission cannot reject a device before functional setup.

Use device_driver_attach() to run the existing bus probe and removal
callbacks under the device lock. This gives manual attachment the same
admission, setup and failure cleanup as automatic probing.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/input/gameport/gameport.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 9707b155bc947..c9efec2dc55da 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -214,26 +214,7 @@ static void gameport_run_poll_handler(struct timer_list *t)
 
 static int gameport_bind_driver(struct gameport *gameport, struct gameport_driver *drv)
 {
-	int error;
-
-	gameport->dev.driver = &drv->driver;
-	if (drv->connect(gameport, drv)) {
-		gameport->dev.driver = NULL;
-		return -ENODEV;
-	}
-
-	error = device_bind_driver(&gameport->dev);
-	if (error) {
-		dev_warn(&gameport->dev,
-			 "device_bind_driver() failed for %s (%s) and %s, error: %d\n",
-			gameport->phys, gameport->name,
-			drv->description, error);
-		drv->disconnect(gameport);
-		gameport->dev.driver = NULL;
-		return error;
-	}
-
-	return 0;
+	return device_driver_attach(&drv->driver, &gameport->dev);
 }
 
 static void gameport_find_driver(struct gameport *gameport)

-- 
2.56.0
Technical Details
Message-ID: <20261105-device-trust-core-v1-1-1e536825b4eb@nvidia.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357263-linux-kernel-netdev=dewy.ru
References: <20261105-device-trust-core-v1-0-1e536825b4eb@nvidia.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357263-linux-kernel-netdev=dewy.ru
From: leon@kernel.org (Leon Romanovsky)
Newsgroups: linux.kernel.netdev
Subject: [PATCH 01/17] Input: gameport - attach manual drivers through the driver core
Date: Thu,  5 Nov 2026 13:42:14 +0200
Organization: Usenet Network
Message-ID: <20261105-device-trust-core-v1-1-1e536825b4eb@nvidia.com>
References: <20261105-device-trust-core-v1-0-1e536825b4eb@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3628951"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:VlgZVxONdG0Mj5Rc0yfk0D2Wb70= sha256:Jl0VWoRq47GYD+nbp+1ka7zILmILyCo5zsTS7t0LsT8=
	sha1:LzKmHFY2C7uJpdH2YXFk5rTQfuA= sha256:dY/jY6l74mv8EEH2ni+y6uPCRV3NYJTHyklZsss8MTc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id C5869112F48; Thu,  5 Nov 2026 14:56:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.301
X-Spam-Status: No, score=-2.301 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001,
	DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id mseVhriS1z_o;
	Thu,  5 Nov 2026 14:56:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-357263-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 76899112F41; Thu,  5 Nov 2026 14:56:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 6E86B2AF3E; Thu,  5 Nov 2026 11:43:40 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793878975;
	b=Exd0/SILn0gQWx50qStHPV2V07CqMFwhp6AUr/QhXVerWbNC+rvfTweMxjZaCE41RzwB
	 EttpT/Bn/Bf0Hq4Az8FXdjrSBIlCzL7ucpaKqEjoAw7swKzHr49bdkTwVl5NIvojIbBgm
	 T2vkCNm0iDdZy1dTJ703xyt+VdQM+KytEBOXcOn1hA6yrnRjEbyFtC0dqMGO1SiK6WLJk
	 gfZMailXziNQ3ommSrs62KaNo4OAxMgl+dhmJONj0G3dEhh+re4YkpzRi6Zlp2AscQRYm
	 TFhMxA7ECsbJ4R5dkygqTW9v8FDxBdr8zDCLHoll9PgwGZq6EqkjtGi9Zs/GfEqhSJg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793878975;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Type:X-Mailer:
	 Content-Transfer-Encoding;
	bh=cqZgEa3fWaSRKdNA/kRQddW5Yao1N6EqxQ4vC2mu8po=;
	b=RzOFXLIFrYwFsfCkEurmKH3MDvOoRykcHNYsJokr8fzfz6qxsCYLL0W1CoGpNPaG7NvU
	 IlgrssL4ZE2gtRH8oFqLWoNDdzjVXubNpW6aymTOOhhH0DiORcl7QsBgxXETkyRTztIOr
	 p+rlq1u0PzlSPkwOk0KNKYqDEvbolyf58vtlFA1BGHRIHRxbEEj0/QpjhtP7E9MWLUeF6
	 oixi3D3KF7Gc/Pncu51jNdSW3PZ6oKFfgVjrVlgM3H83N+1B4P8gfi/cP1JH8fIItJzaQ
	 AxNnjbxy3NiAxYvLROoa7dIRetwf4r8aAXYe35YGyfWSNb0PjMrrpMqErZd5Lrb9WNQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TZxrngzB;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A3741606D82D;
	Thu,  5 Nov 2026 11:42:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TZxrngzB
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793878969;
	b=arqXehG9kuumvEuSWkssmManquAdOgdbHdCbUSr7SeSNqaU2giyeJfo3IFqqaIkuAU5l
	 2/uQemHYSTC1JguxWz5N71RRUUcnwfHUIJwzzBQD9rIOOQASqcLIn42xGzQAIrFmjpBX9
	 z/Zp4TBlH2MrjFTIc/zGaKkF6e1wHq8SVFC4QotzYMFNmDLe4pxE/tctlYn3xgQ4w2wh5
	 hITyBp82eMhsZgZcjZXIq0IYs52WBXglPBrrfl+VzmHR8TqTnipTmBm1wHOCqOZFJ6aib
	 /IS7uMFHpyMFH8sFIaONgLEhNnZlE0Ic3b94FhWwq6kU8iHiLc7+l7P6qLlQncwGvoQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793878969;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:MIME-Version:Content-Type:X-Mailer:
	 Content-Transfer-Encoding;
	bh=cqZgEa3fWaSRKdNA/kRQddW5Yao1N6EqxQ4vC2mu8po=;
	b=HeEu33g7EA9z56S4GtKarhnEDlHlBVebn2CQYGD4MzpFpk071/jCKVJUxFqlzY6ApIT1
	 RucpZ3NYlKOOwfTs4ynjI2h3qX4oscIsmAXZrwwEKSVCg3hqQWQLlEi4aJc9eQNhrXulO
	 iWUdzqwV8sGOK3fhYuEXMOO60NZeDDNsJfvEFfCvwUxsHE8d+weTmo8kDHX83O+Zqnv9Q
	 8WncXsxNNCbGpfHKK/yEX/qFJmtCSq6Zzg9fgpC2JiQD35CtM59ehtTRYnYALu6zOa0XX
	 thE6Lz1qel5t2tKz6Kl2Cb+2yuYmElXTMMWUnakf++g6pSXVd4mxVG0Wa7Ltk5uwgPw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TZxrngzB;
	arc=none smtp.remote-ip=100.103.45.18
X-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 5A454606A331;
	Thu,  5 Nov 2026 11:42:49 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0391C1F000C1;
	Thu,  5 Nov 2026 11:42:48 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793878969;
	bh=cqZgEa3fWaSRKdNA/kRQddW5Yao1N6EqxQ4vC2mu8po=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=TZxrngzB1E1pJVoVqirsVSVSCKIBFFy5KNVKCWITnqq9FWXxij3jNeO5+uBfw04Mi
	 XeFZuHTEbef0o4Uok2oqxq3VqybwlxxV0Q1WM7fIH9tOgso7ZseC1MRPoyc3Es6ars
	 z9NVUJrMxvQqp9oK2LkUU97NMQgBne6M/R3uz/jyOgkI8vV6fUBAHINw5MKBlbJny6
	 b+uIaiiQ/RjxORFhnIK+Oeu0Mh/IZNzd+Qm9Unntu/37ijV+fxI88ANdeBs0rKPw5C
	 CDK6EOWnkt3tOsGxST/ud/ZCkwsblZBNYkYvVnT4TV2G+io4BNGfEm6huWIAp6Jg4m
	 cI/+WIoTE/sew==
X-Cc: linux-kernel@vger.kernel.org,
	driver-core@lists.linux.dev,
	linux-input@vger.kernel.org,
	netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org,
	linux-usb@vger.kernel.org,
	linux-bluetooth@vger.kernel.org,
	linux-acpi@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-pci@vger.kernel.org,
	iommu@lists.linux.dev,
	Jason Gunthorpe <jgg@ziepe.ca>
X-Mailer: git-send-email 2.56.0
X-In-Reply-To: <20261105-device-trust-core-v1-0-1e536825b4eb@nvidia.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Mailer: b4 0.15-dev-18f8f