lkml.org 
[lkml]   [2013]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [5/6] i2c: Ignore the return value of i2c_del_mux_adapter()
On Sat, Mar 09, 2013 at 06:16:48PM -0000, Lars-Peter Clausen wrote:
> 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). A subsequent
> patch will make the return type of i2c_del_mux_adapter() void.
>
> Cc: Guenter Roeck <guenter.roeck@ericsson.com>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>
> ---
> drivers/i2c/muxes/i2c-mux-pca954x.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
> index 8e43872..a531d80 100644
> --- a/drivers/i2c/muxes/i2c-mux-pca954x.c
> +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
> @@ -262,13 +262,11 @@ static int pca954x_remove(struct i2c_client *client)
> {
> struct pca954x *data = i2c_get_clientdata(client);
> const struct chip_desc *chip = &chips[data->type];
> - int i, err;
> + int i;
>
> for (i = 0; i < chip->nchans; ++i)
> if (data->virt_adaps[i]) {
> - err = i2c_del_mux_adapter(data->virt_adaps[i]);
> - if (err)
> - return err;
> + i2c_del_mux_adapter(data->virt_adaps[i]);
> data->virt_adaps[i] = NULL;
> }
>


\
 
 \ /
  Last update: 2013-03-13 07:41    [W:0.138 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site