-/* $OpenBSD: drm_linux.c,v 1.91 2022/02/28 02:40:16 jsg Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.92 2022/03/01 11:50:37 jsg Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
}
int
-i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+__i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
int ret, retries;
- if (adap->lock_ops)
- adap->lock_ops->lock_bus(adap, 0);
-
retries = adap->retries;
retry:
if (adap->algo)
goto retry;
}
+ return ret;
+}
+
+int
+i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ int ret;
+
+ if (adap->lock_ops)
+ adap->lock_ops->lock_bus(adap, 0);
+
+ ret = __i2c_transfer(adap, msgs, num);
+
if (adap->lock_ops)
adap->lock_ops->unlock_bus(adap, 0);
-/* $OpenBSD: i2c.h,v 1.5 2022/03/01 04:08:04 jsg Exp $ */
+/* $OpenBSD: i2c.h,v 1.6 2022/03/01 11:50:37 jsg Exp $ */
/*
* Copyright (c) 2017 Mark Kettenis
*
struct i2c_controller ic;
};
+int __i2c_transfer(struct i2c_adapter *, struct i2c_msg *, int);
int i2c_transfer(struct i2c_adapter *, struct i2c_msg *, int);
-static inline int
-__i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
-{
- return i2c_transfer(adap, msgs, num);
-}
-
static inline int
i2c_add_adapter(struct i2c_adapter *adap)
{