i2c: Make the return type of i2c_del_mux_adapter() void
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 9 Mar 2013 08:16:49 +0000 (08:16 +0000)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 2 Apr 2013 05:07:32 +0000 (07:07 +0200)
i2c_del_mux_adapter always returns 0 and none of it current users check its
return value anyway. It is also an essential requirement of the Linux device
driver model, that functions which may be called from a device's remove callback
to free resources provided by the device, are not allowed to fail. This is the
case for i2c_del_mux_adapter(), so make its return type void to make the
fact that it won't fail explicit.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-mux.c
include/linux/i2c-mux.h

index 361b78d76759480493811890669a1f4b4e68d2c4..7409ebb33c47df7166087f937d0d5eb91d9d70c9 100644 (file)
@@ -191,14 +191,12 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
 }
 EXPORT_SYMBOL_GPL(i2c_add_mux_adapter);
 
-int i2c_del_mux_adapter(struct i2c_adapter *adap)
+void i2c_del_mux_adapter(struct i2c_adapter *adap)
 {
        struct i2c_mux_priv *priv = adap->algo_data;
 
        i2c_del_adapter(adap);
        kfree(priv);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(i2c_del_mux_adapter);
 
index 40cb05a97b4602d802bd222a3f207c99fab7b564..b5f9a007a3abdd9216aa02bcd06479ffae20bd4b 100644 (file)
@@ -42,7 +42,7 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
                                int (*deselect) (struct i2c_adapter *,
                                                 void *mux_dev, u32 chan_id));
 
-int i2c_del_mux_adapter(struct i2c_adapter *adap);
+void i2c_del_mux_adapter(struct i2c_adapter *adap);
 
 #endif /* __KERNEL__ */
 
This page took 0.039092 seconds and 5 git commands to generate.