Article View: linux.kernel.netdev
Article #13030[PATCH v2 09/19] Input: serio - use the compatibility driver attachment API
From: Leon Romanovsky
Date: Mon, 09 Nov 2026 07:33
Date: Mon, 09 Nov 2026 07:33
54 lines
9559 bytes
9559 bytes
From: Leon Romanovsky <leonro@nvidia.com>
Manual serio binding invokes connect and publishes the binding under its
own subsystem serialization. Driver core needs an entry point before
connect to enforce device trust admission.
Use device_driver_attach_full() after the port ID check. Preserve the
existing locking and let the helper handle probe and binding cleanup.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/input/serio/serio.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 54dd26249b027..b54072769ab68 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -81,28 +81,10 @@ static int serio_match_port(const struct serio_device_id *ids, struct serio *ser
static int serio_bind_driver(struct serio *serio, struct serio_driver *drv)
{
- int error;
-
- if (serio_match_port(drv->id_table, serio)) {
-
- serio->dev.driver = &drv->driver;
- if (serio_connect_driver(serio, drv)) {
- serio->dev.driver = NULL;
- return -ENODEV;
- }
+ if (!serio_match_port(drv->id_table, serio))
+ return 0;
- error = device_bind_driver(&serio->dev);
- if (error) {
- dev_warn(&serio->dev,
- "device_bind_driver() failed for %s (%s) and %s, error: %d\n",
- serio->phys, serio->name,
- drv->description, error);
- serio_disconnect_driver(serio);
- serio->dev.driver = NULL;
- return error;
- }
- }
- return 0;
+ return device_driver_attach_full(&drv->driver, &serio->dev);
}
static void serio_find_driver(struct serio *serio)
--
2.56.0
Technical Details
Message-ID:
<20261109-device-trust-core-v2-9-3b12d9a9f861@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-359080-linux-kernel-netdev=dewy.ruReferences:
<20261109-device-trust-core-v2-0-3b12d9a9f861@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-359080-linux-kernel-netdev=dewy.ru From: leon@kernel.org (Leon Romanovsky) Newsgroups: linux.kernel.netdev Subject: [PATCH v2 09/19] Input: serio - use the compatibility driver attachment API Date: Mon, 9 Nov 2026 09:33:39 +0200 Organization: Usenet Network Message-ID: <20261109-device-trust-core-v2-9-3b12d9a9f861@nvidia.com> References: <20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="298449"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:oG0EMMUEo6pg9YAI9MyuxSEZ1XY= sha256:5pzryLaW6xqS3svNT00k8tSU8WIB62vx/ZqYfzRxwcE= sha1:s3Z7X+L6/OigrC39uAzz23fsaIk= sha256:PmR/xrbF8Z8z0gncfRX839M0P2+F652ZT6YxBvzT350= 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 97D5E113704; Mon, 9 Nov 2026 10:36:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[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 364Fwux4FsDl; Mon, 9 Nov 2026 10:36:29 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-359080-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 1DBC41136EB; Mon, 9 Nov 2026 10:36:21 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 3D076610431; Mon, 9 Nov 2026 07:35:56 +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=1794209676; b=h2SAAUJE27aHErzYK7GFBEJU7ciP7XYmtJpBLuWK+kqchmhOPXYBfrpdrkTzItyjMdRt sWG88SAoOm8jU6Fil5ez9MEBz/bhrWKfGCTOCqOxzYIc+LrLxefSmzZc/ZvopibXf/HFP e4iSQDbeEqlhDxdcxYgEQJrQcQFzHX1Jh6wwRgfcwxV5X+Jn9r5dMGMJujIMWX2cdFn7/ M/3wn4tC4LAFFrhF9hwMIciIAb4WSwy/eI8iy8LMSjGBKj7/wy4b4uVHJTmxxVpw7oxPx 0KRWDVfAHBBZow1jgAJlu8UIzHTpQ8wWZ/D5fjmH/ATpwcR3OO4hnVaTc5PlqtTpxBQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794209676; 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=esc9u5h8nOfzpC94QRqfexD7Tae+1nWvmVwsrbhWx44=; b=L/rP5uAvkeuUTzfqld6CRVVUIf+TD4rvr8GSmwgGGlt2jUGqhw1WWs3PUUk+lR2FhzZo LpDVczqYcMO2uKt6Ga5wpvG6P/7OHBSeRxYEqPuvlGhUgARFV5zgxodWl00DesyFjkrIq 8Da+enPyI/L5h1OET92wTd783+gqyUcYX/njuElGODs/h8N0o5nhBZrn8798zoFoMt38C Tr6Fyast9qu24HifjGKqKsxKRPSnQlHJxni/gTIaZXviwK7YbUWhVHXtdd/xslBeBV8EC 1DSFs5tqTcITJdmhu70+ujxiXjcgkX3AXzXumVNfJ1nU059X4pG2k8Lg8o9vEq7x+SA== 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=XcRiolhR; 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 F37A560A3818; Mon, 9 Nov 2026 07:34:35 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XcRiolhR 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=1794209670; b=Od7W2Lv2HeB+uCjmVddRYj8nsO9KZYbFwYn1sSJo2VISaN3S6PBwZRgb2mWWGOPjsHGs Q+7SB623/Mh9BuXJK1GZhQv+1x3vJ+cXlK91L9Qj33mhUXzNpL8N8Xmf7vSWvVcesZpi/ 9LkjPKyqzFn3jgxBZcwE3xmL/M/oObUSlhLo6JqOuD8JJSR77ORB8GhZ8+r1jMHzKrU6Q vtAoFBXTJGp7V0dNNOKhHh6Ifx0OJ3+E7SeDzE5kFR+P0q1GzGPO+AoTmfx5AElwg1A5D cCtEtA3B5Avoa3MJlGZTsY/5VJd11EALsD0+ZQp5xPk3yeuM99TCcs7kS1hMmY6KdkA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794209670; 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=esc9u5h8nOfzpC94QRqfexD7Tae+1nWvmVwsrbhWx44=; b=Ttw+ctwlD7a6au+8A+/8lqj916jxTmC8k2c6G6vykRiNcz/GkONOlOyqvQ2jHu8O26P7 YgQQSqSeJ6s1baj/vCdXNk3z0E/9OJmfErqH4OqEEJaa+OH1HdomGtsJvS8ctxOiGgwOS g1+H0huFGviO8g2Ks7ndPkVy6IHi5oNt7mrtJqFUh4u63GO7mRay3CvYBeTamsq9E4imD gK+xtrR7bCUQGdTRkrthhUx+Skpz3CWAQYCTY7XZADethG1jYqsJCC4Z5RbK38jEeFuzV 6HIk5cAUHCGgi3blndiVvzC44TcmC0Pt2xhdvU7NQ3v7SOrfFU+VgKVzfdLE6fyWGdA== 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=XcRiolhR; 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 D0138606D816; Mon, 9 Nov 2026 07:34:29 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE6BE1F008A1; Mon, 9 Nov 2026 07:34:28 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794209669; bh=esc9u5h8nOfzpC94QRqfexD7Tae+1nWvmVwsrbhWx44=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XcRiolhRIA0fkin82BnV5Mz7Eg4PU5O+xYrDITtO71vHvH0RwQd8VJblq8+YS4h3T NOkB+bnPBQXa1v7EuatD5G0/EDIlXbmpoZwzNTxNIGhGRqohn36IiODzdQ7yyWM917 TnAONCGBnLJK7j3fN2SrDeIIPa85cnkng+xOF1KNVZcJMcpv7strjc23rZFjzl1mV8 ahptbyXit3g2EgyF/FpAkJYIZrwFpqJ3mVcNu5B+UwdLNsyJF95LfG8pseXE8pJmBd 8YaxHb266eHE0QJNZQ5+A82Vo2mKkmfOXtn10V3wzJlQ7L2JskhUGREK34/cLTER8t GYBp7PsFmuKCg== 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: <20261109-device-trust-core-v2-0-3b12d9a9f861@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