diff options
author | Mark M. Hoffman <mhoffman@lightlink.com> | 2006-07-01 11:16:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-07-12 18:43:07 -0400 |
commit | b39ad0cf7c19fc14e8f823b1b36245f7a3711655 (patch) | |
tree | f30e4dcfb21bc6aae1dc8300cef28b912339d72c /drivers/i2c/algos/i2c-algo-pcf.c | |
parent | 5d925fecac26651e6b0e19cf4ca16933aa640f99 (diff) |
[PATCH] i2c: Handle i2c_add_adapter failure in i2c algorithm drivers
Content-Disposition: inline; filename=i2c-algo-error-handling-fix.patch
It is possible for i2c_add_adapter() to fail. Several I2C algorithm
drivers ignore that fact. This (compile-tested only) patch fixes them.
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-pcf.c')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pcf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c index 6e498df1f717..5b24930adb5a 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c | |||
@@ -479,9 +479,11 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap) | |||
479 | adap->timeout = 100; /* default values, should */ | 479 | adap->timeout = 100; /* default values, should */ |
480 | adap->retries = 3; /* be replaced by defines */ | 480 | adap->retries = 3; /* be replaced by defines */ |
481 | 481 | ||
482 | rval = pcf_init_8584(pcf_adap); | 482 | if ((rval = pcf_init_8584(pcf_adap))) |
483 | if (!rval) | 483 | return rval; |
484 | i2c_add_adapter(adap); | 484 | |
485 | rval = i2c_add_adapter(adap); | ||
486 | |||
485 | return rval; | 487 | return rval; |
486 | } | 488 | } |
487 | 489 | ||