From patchwork Sat Nov 15 18:52:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 709 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763232818; bh=sORUmiMXaUt+nKDcNzvLggD9BYWUhlh0eN0S7seMZEg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KUniqL2aqgP/zvyda2eBs62UfWZMc/LO1Qvx5yaI1qdxoqJmVYvh8j1GmYIEvBsG6 prnjSz1EINK5vVnRqQ+yD9BUsQhwannqZeoKGYw4hfSc8x/c8Jq39DIh3RnSAdDwjP jPqP8FbJxPfslg9FLTOcpxvx/wxCDO47uLZ/YaH52Fge2qLHS95A9CzJX4MW8jK5S/ 8yDXAS0ulr9GhK3C/QwwCmsmrqVSpwk4ebBpa/YAiqqP2lr895YXMoYx4vW7aZn/qP KVKg44wwFSjD4fqspUQF0/cqYsplOqXfh7Gp6X9ab0wGxR3bDnxIB6OXB7RJJokvLs 5jq3CCz9fhrHg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 715476857C for ; Sat, 15 Nov 2025 11:53:38 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Zrs-mIsHWd5j for ; Sat, 15 Nov 2025 11:53:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763232817; bh=sORUmiMXaUt+nKDcNzvLggD9BYWUhlh0eN0S7seMZEg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=P92v8EvQ3UH02QuecyAz9lut0F4Wz5EaZrvypmMTsK8HsFpyCAb47mg0EoMpuHueo 4WEbVcJUwyn+aYYP9g2ScSeIvdkZ5LdGK1CvGGAP5ksAd2QoCa87ma9Ztdp2lNXJmr FmXAye48ET1ykm4cMb6SuAwnK8cuhRmNlNKJD2Y4pqiPkF9q+tna/hxaeIO6vz68aA zWNP5XgIlcz5HYmV7aNyTvJ+B4xCvzzFMqn/0JsDHlK0RP1ZfZR4dJ1V+Oaa6mj1i2 8ImN9Qk90UnXKo10lIggVkYwP9/RUk5H42ecIkth8e+IZKOiTrJoA5wTwb/NGL8O/n fBWdveO79IgCg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EF4B76861B for ; Sat, 15 Nov 2025 11:53:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763232814; bh=+/zdle74ARPJ4ya1j4E+FHm5zHoffgS1prMVwdH1uQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VcqGMe4lLNil3i/x/bxsffft+OCUEwb1AsbxzrfAWHhTNwwo2q6fI8Gg+saqBbEyh SgirhZN5hIdtPGGEp42atDx+BxjHgekkg4prc6WYsPsANtswzeDj7r6i0BaxDFoZqS xdVqnmuhotgOnJv/cJX4BArD3tCaiaKU7C8YvqKZxIb5YlsLImGseJB0iePsgz11z5 qwuMynM2uNtlXhbq/GfFtWF8xnSBywrkwQ6RwJmn3xODPWQC4gB3m9yWsakrFb8eZ3 L8JvtSA1Dk6KIfuviQCrklrT3K6c8Z8Etc+3f2tOO/Uhe9f4AsGGSR/cny5fpfQw/m 9RUEtBirGHV3A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5A2766857C; Sat, 15 Nov 2025 11:53:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id lgPmpexqwaI1; Sat, 15 Nov 2025 11:53:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1763232814; bh=234/qSL/SZBu0FErrVy+wEurCDwGiSuMBOk7fpRgwUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rL7oiTshgR4SjrcoOeJ3sEvAfHFRXMkcquYEXxi0ZbCsgbjqxlpydOWSgcP2hwOqW 9Os4JpGsOapiM7MyF8F7Tv0rQ8ti0p/uOoiT3vejnoDsBF+sGG6FxbyzjImu3VEoKm ZpxcwbEDrorZnpQfOGQq9vOL0pzIpn7BCn1VqboNYKKxNbxQSJV5RTAJlaj3NtQe8n raRhIbYxn/kZaptXlI8RNs8jV4zYvl2lc3rojDNOHc6ojN4gQJG4nOsoJXJQNDXSf7 MeR3eZfSLcMZOVKYFKfPN0SojEJNkOC27srL++2LF3+1dfn5r5dL9VjJ/zac031M+N DzXdF0uWeVhuQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DD984685D9; Sat, 15 Nov 2025 11:53:33 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 15 Nov 2025 11:52:00 -0700 Message-ID: <20251115185212.539268-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251115185212.539268-1-sjg@u-boot.org> References: <20251115185212.539268-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6C5C6W34HEUYTVQGYMIYZV7ABMYVOSKK X-Message-ID-Hash: 6C5C6W34HEUYTVQGYMIYZV7ABMYVOSKK X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/16] tkey: sandbox: Avoid returning -ENODEV from the driver List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass With driver model, -ENODEV has a specific meaning, i.e. there is no device. Return -EIO instead, since the device actually does exist in driver model, even if it is not currently connected. Remove a few error messages which we are here. Signed-off-by: Simon Glass --- drivers/misc/tkey_sandbox.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/misc/tkey_sandbox.c b/drivers/misc/tkey_sandbox.c index 9b26bd36f1b..27d3ffaf123 100644 --- a/drivers/misc/tkey_sandbox.c +++ b/drivers/misc/tkey_sandbox.c @@ -37,7 +37,7 @@ static int tkey_sandbox_read(struct udevice *dev, void *buffer, int len, int total, ret; if (priv->fd < 0) - return -ENODEV; + return -EIO; log_debug("Reading %d bytes...\n", len); @@ -78,7 +78,7 @@ static int tkey_sandbox_write(struct udevice *dev, const void *buffer, int len) int ret; if (priv->fd < 0) - return -ENODEV; + return -EIO; log_debug("Writing %d bytes:", len); for (int i = 0; i < len; i++) @@ -112,17 +112,17 @@ static int tkey_sandbox_probe(struct udevice *dev) /* Open the serial device */ priv->fd = os_open(priv->path, OS_O_RDWR); if (priv->fd < 0) { - log_err("Failed to open %s (error %d)\n", priv->path, priv->fd); + log_debug("Failed to open %s (error %d)\n", priv->path, priv->fd); free(priv->path); - return -ENODEV; + return -ENOENT; } /* Configure serial port for raw mode */ if (os_tty_set_params(priv->fd) < 0) { - log_err("Failed to configure serial port %s\n", priv->path); + log_debug("Failed to configure serial port %s\n", priv->path); os_close(priv->fd); free(priv->path); - return -ENODEV; + return -EIO; } log_debug("Connected to %s with serial parameters configured\n", priv->path);