Article View: linux.kernel.netdev
Article #11629[PATCH 02/17] Input: serio - attach manual drivers through the driver core
From: Leon Romanovsky
Date: Thu, 05 Nov 2026 11:42
Date: Thu, 05 Nov 2026 11:42
54 lines
9602 bytes
9602 bytes
From: Leon Romanovsky <leonro@nvidia.com>
Manual serio binding connects a driver before driver core can admit the
device. A rejected binding therefore arrives after functional setup.
Keep the port ID check and use device_driver_attach() for the existing bus
probe path. Driver core then serializes admission and handles probe failure
before publishing the binding.
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..604440244c1ca 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(&drv->driver, &serio->dev);
}
static void serio_find_driver(struct serio *serio)
--
2.56.0
Technical Details
Message-ID:
<20261105-device-trust-core-v1-2-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-357261-linux-kernel-netdev=dewy.ruReferences:
<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-357261-linux-kernel-netdev=dewy.ru From: leon@kernel.org (Leon Romanovsky) Newsgroups: linux.kernel.netdev Subject: [PATCH 02/17] Input: serio - attach manual drivers through the driver core Date: Thu, 5 Nov 2026 13:42:15 +0200 Organization: Usenet Network Message-ID: <20261105-device-trust-core-v1-2-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="3627292"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ZHFNlmQ8ZEMA7OkzWVlE7RkyXAo= sha256:5y7WSTYNRJ3VPWx32fcaSmf/Ucvxgvihhlbux+TxqSg= sha1:F1/kJ9sqwaO4PsqdKKLcK5e/Ww8= sha256:/b9bou4OEvjQHxklBeo6i6QVNbZ3h2RsboNrn2cgJMI= 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 26D8D112F43; Thu, 5 Nov 2026 14:49:48 +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 cv6BdLJ2d9s4; Thu, 5 Nov 2026 14:49:45 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-357261-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 3EEB6112F14; Thu, 5 Nov 2026 14:49:37 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 668A02C81E; Thu, 5 Nov 2026 11:43:54 +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=1793878983; b=FvmEQevAQpoyhPMKvv+scGnJRR/0xjD1KVeJYk1qKspX+P2LHoKMpzLxansXZBXfiamW LkZtGnY3XInhtqRkkg3SJn3S7bDKUjgsFr00JCmOrNADqpGEU0esuIuHBvlsrCQZbDLnV 7ZlTS/ceGS3c7diXjDY/qtdrlNlr0sZovdXiMQz8ftjT8ygRtixMoqrzAB3CHozAVICql 7GMTW2wp3A2F42zHbteQvCJfynpttt/EA3eKsYfcNDMYaNXcHiWWyFqH7eSYCYyIqgiip u0zexirIP4ndPXUBK/eRJ3jE8MSHTVQmpn239g3xbi1LPpxqV95Xr3FBqA+DQn8h0NA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793878983; 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=q/Qxk6NeWhoD49CZMGNhUQK3Ye1Uhy5tudrbI2veMqg=; b=HILeBSDCHp+Rbw/RGS/fHy6yfthFQ/MHAeRfNYwpjaAN1ny1KppTiqow/+7quFlv7quD +wbu6bcd2H+S7B4c5RPn63k5DtPk0mzYYklXLhjIejCsDGCX7f5VBKEznp4TFi5F2KMAs PpJO5jo6RRLHk4lGgHl83soePyIhhVmszqcRvpKFuolYnHqqASWJVku7Mf/BXPfPpWxoB MSXuAEMwgusPcoUih6AW28jtrwHf5N7t18pzn+wSchhmK1W5uQWHDHgX/hXd1mfhDwMvr Uj8Un8h+h04rl875Yl6LlMLPdnOIL797Lb3tNLac+FAsFHwXhEw3SAVRqnBXFSALT5A== 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=UW7yjrIx; 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 4E54F606D83F; Thu, 5 Nov 2026 11:43:03 +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=UW7yjrIx 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=1793878962; b=wT/XadydeQeBuFy7DsD0UiYk3ADtVruFucXZiTw6VfhKGJQc4b8RhxTetjPod8inJKx3 NWljKmjdq4aAIuog0RcsVVb9fyaX6/kJha+rNFZ58j6Tz+vfT6dZ27JlGkqhHltY2cCRa KHV0hc+vsIJ/brgRIRZXV49BxwXbwZvtpt7uY+oWRy9X5oXG+IF1rRoSXn27F5h79gyhm oBPpv2tHMv/65ZtR04lyf6sBubcpBhs0LiXLhmHDxSkvIkFCL5L9RRKN82aOpIR0OXSo3 Z4YJDbmp8CaP8RZB3RY6JXsYeTZi4epCLA5pj1cKswX0j3NNnYPVunio6Qg7S5o1hDQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793878962; 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=q/Qxk6NeWhoD49CZMGNhUQK3Ye1Uhy5tudrbI2veMqg=; b=yb/G7HuF7PCveQrq8XpHxXMQP5cLmcZM+Q3BnW7nJRmA4zqX5m4dcTxPMTlQGlU5HYSV es5zV4yyq74IaL2xbFJQVFQf4xKMsJk/npuFmFjXyd3006lSFBvWe+ciKblzLJdK1UUC3 XX9SXL01B0jHXHIHUuOrfTjD9xMo+q6Cvui1fLaho2K/WXV53sbCz/1Yi3vrm3v2liPVC bReLypLFxz+79BjztdX1ur4Tn8diBK5c2OqVvgf0VoSekFbGoZGYr13I5kkmEJ/pduYoZ dAoEZqGM9qHjdvY6ov+eMRzezNgpryq0lw/aSbD9b4b6AN+TD8wQKFBdkbNWwE4WMtw== 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=UW7yjrIx; 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 26D1E606A337; Thu, 5 Nov 2026 11:42:41 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E152E1F000C1; Thu, 5 Nov 2026 11:42:40 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793878961; bh=q/Qxk6NeWhoD49CZMGNhUQK3Ye1Uhy5tudrbI2veMqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UW7yjrIxoMuhKqJCMOf168PwSNa9h/+jej36Fcd/LWKz5NuA9QtRSYRCMSNZd7xvT jjcrXib9VxfxHay7RdARYM8NeU7zB0bpwGwwYgzD0CvNPnXv/GLWtp2jAQT48bHD7c tyeFBzdliTt5BAw3wlKkrQR+vugiNfVUR38D88DQyDcjJfsvxOt8nVfm/MhstM8+TS AK53IyoMUg23I94IuY9b8bE+ecVbmF/PCb3YYyz3iMsn0TvN96HrYZhD0ZXbDQn4U8 ZQ+r3uBNwMmpMzz06/7ItmYDusnSaVPAiPDlo7jBWoXZuaJurDJCWMhQghPLntFzVc IF5WqejG+eXSg== 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