backports: fix i2c_add_mux_adapter() parameters
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 1 Jan 2014 23:43:08 +0000 (00:43 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 18 Jan 2014 12:44:01 +0000 (13:44 +0100)
The class parameter was added in kernel 3.7 to i2c_add_mux_adapter()
and could just be ignored by older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/i2c-mux.h [new file with mode: 0644]

diff --git a/backport/backport-include/linux/i2c-mux.h b/backport/backport-include/linux/i2c-mux.h
new file mode 100644 (file)
index 0000000..a3a67ad
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_LINUX_I2C_MUX_H
+#define __BACKPORT_LINUX_I2C_MUX_H
+#include_next <linux/i2c-mux.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+#define i2c_add_mux_adapter(parent, mux_dev, mux_priv, force_nr, chan_id, class, select, deselect) \
+       i2c_add_mux_adapter(parent, mux_dev, mux_priv, force_nr, chan_id, select, deselect)
+#endif
+
+#endif /* __BACKPORT_LINUX_I2C_MUX_H */