Module Name:    src
Committed By:   martin
Date:           Sun Feb  2 15:01:35 UTC 2025

Modified Files:
        src/sys/dev/i2c [netbsd-10]: i2c.c

Log Message:
Pull up following revision(s) (requested by brad in ticket #1044):

        sys/dev/i2c/i2c.c: revision 1.91

Fix a likely bug in iic_ioctl.

The error variable was being over written by the copyout call.  The
effect here is that the I2C transaction could have errored, but then
the copyout is performed in the read case and if that worked, error
would end up 0.  Just don't do the copyout if the I2C transaction
errored.

Also, don't return twice.  Once is enough.

With this, "i2cscan -r ..." on a RPI will work as expected.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.90.2.1 src/sys/dev/i2c/i2c.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to