Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2026 00:18:13 +0000
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0a705587e472 - main - iicmux: Return the right error codes
Message-ID:  <69f29fc5.3172a.3c5fb8db@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=0a705587e4720cdb0317efb80e9452d236c5cfcf

commit 0a705587e4720cdb0317efb80e9452d236c5cfcf
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2026-04-22 22:49:16 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2026-04-30 00:14:19 +0000

    iicmux: Return the right error codes
    
    I2C subsystem errors belong in the IIC_* error space.  It's pretty clear
    this is what is intended in the code.
---
 sys/dev/iicbus/mux/iicmux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/dev/iicbus/mux/iicmux.c b/sys/dev/iicbus/mux/iicmux.c
index 96164719577c..32b7405ebe19 100644
--- a/sys/dev/iicbus/mux/iicmux.c
+++ b/sys/dev/iicbus/mux/iicmux.c
@@ -62,7 +62,7 @@ iicmux_callback(device_t dev, int index, caddr_t data)
 
 	/* If it's not one of the operations we know about, bail early. */
 	if (index != IIC_REQUEST_BUS && index != IIC_RELEASE_BUS)
-		return (iic2errno(EOPNOTSUPP));
+		return (errno2iic(EOPNOTSUPP));
 
 	/*
 	 * Ensure that the data passed to us includes the device_t of the child
@@ -72,12 +72,12 @@ iicmux_callback(device_t dev, int index, caddr_t data)
 	 */
 	rd = (struct iic_reqbus_data *)data;
 	if (!(rd->flags & IIC_REQBUS_DEV))
-		return (iic2errno(EINVAL));
+		return (errno2iic(EINVAL));
 
 	for (i = 0; i <= sc->maxbus && sc->childdevs[i] != rd->bus; ++i)
 		continue;
 	if (i > sc->maxbus)
-		return (iic2errno(ENOENT));
+		return (errno2iic(ENOENT));
 
 	/*
 	 * If the operation is a release it "cannot fail".  Idle the downstream


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f29fc5.3172a.3c5fb8db>