]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/i2c/i2c-mux.c
dpaa2-eth: Fix TX FQID values
[linux.git] / drivers / i2c / i2c-mux.c
index 603252fa12843bf8f7aee3fb64ad476de6caa8a0..774507b54b57b7e722ee77fa1e8952fb29b30b1c 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/slab.h>
+#include <linux/sysfs.h>
 
 /* multiplexer per channel data */
 struct i2c_mux_priv {
@@ -243,8 +244,7 @@ struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent,
 {
        struct i2c_mux_core *muxc;
 
-       muxc = devm_kzalloc(dev, sizeof(*muxc)
-                           + max_adapters * sizeof(muxc->adapter[0])
+       muxc = devm_kzalloc(dev, struct_size(muxc, adapter, max_adapters)
                            + sizeof_priv, GFP_KERNEL);
        if (!muxc)
                return NULL;