[PATCH 1/6] i2c: Remove detach_adapter

2013-03-09 Thread Lars-Peter Clausen
The detach_adapter callback has been deprecated for quite some time and has no user left. Keeping it alive blocks other cleanups, so remove it. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/i2c/i2c-core.c | 33 ++--- include/linux/i2c.h| 7 ++-

[PATCH 0/6] Make return type of i2c_del_adapter() (and i2c_del_mux_adapter()) void

2013-03-09 Thread Lars-Peter Clausen
Currently i2c_del_adapter() returns 0 on success and potentially an error code on failure. Unfortunately this doesn't mix too well with the Linux device driver model. An i2c_adapter is usually registered in a drivers probe callback and removed in the drivers remove callback. The Linux device

[PATCH 2/6] i2c: i2c_del_adapter: Don't treat removing a non-registered adapter as error

2013-03-09 Thread Lars-Peter Clausen
Currently i2c_del_adapter() returns -EINVAL when it gets an adapter which is not registered. But none of the users of i2c_del_adapter() depend on this behavior, so for the sake of being able to sanitize the return type of i2c_del_adapter argue, that the purpose of i2c_del_adapter() is to remove an

[PATCH 3/6] i2c: Ignore return value of i2c_del_adapter()

2013-03-09 Thread Lars-Peter Clausen
i2c_del_adapter() always returns 0. So all checks testing whether it will be non zero will always evaluate to false and the conditional code is dead code. This patch updates all callers of i2c_del_mux_adapter() to ignore the return value and assume that it will always succeed (which it will). In a

[PATCH 4/6] i2c: Make return type of i2c_del_adapter() void

2013-03-09 Thread Lars-Peter Clausen
i2c_del_adapter() is usually called from a drivers remove callback. The Linux device driver model does not allow the remove callback to fail and all resources allocated in the probe callback need to be freed, as well as all resources which have been provided to the rest of the kernel(for example a

[PATCH 5/6] i2c: Ignore the return value of i2c_del_mux_adapter()

2013-03-09 Thread Lars-Peter Clausen
i2c_del_mux_adapter() always returns 0. So all checks testing whether it will be non zero will always evaluate to false and the conditional code is dead code. This patch updates all callers of i2c_del_mux_adapter() to ignore its return value and assume that it will always succeed (which it will).