diff options
Diffstat (limited to 'drivers/i2c/i2c-mux.c')
-rw-r--r-- | drivers/i2c/i2c-mux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 603252fa1284..774507b54b57 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/of.h> | 27 | #include <linux/of.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/sysfs.h> | ||
29 | 30 | ||
30 | /* multiplexer per channel data */ | 31 | /* multiplexer per channel data */ |
31 | struct i2c_mux_priv { | 32 | struct i2c_mux_priv { |
@@ -243,8 +244,7 @@ struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent, | |||
243 | { | 244 | { |
244 | struct i2c_mux_core *muxc; | 245 | struct i2c_mux_core *muxc; |
245 | 246 | ||
246 | muxc = devm_kzalloc(dev, sizeof(*muxc) | 247 | muxc = devm_kzalloc(dev, struct_size(muxc, adapter, max_adapters) |
247 | + max_adapters * sizeof(muxc->adapter[0]) | ||
248 | + sizeof_priv, GFP_KERNEL); | 248 | + sizeof_priv, GFP_KERNEL); |
249 | if (!muxc) | 249 | if (!muxc) |
250 | return NULL; | 250 | return NULL; |