diff options
| author | Mark M. Hoffman <[email protected]> | 2006-07-01 15:16:06 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2006-07-12 22:43:07 +0000 |
| commit | b39ad0cf7c19fc14e8f823b1b36245f7a3711655 (patch) | |
| tree | f30e4dcfb21bc6aae1dc8300cef28b912339d72c /drivers/i2c/algos/i2c-algo-pca.c | |
| parent | [PATCH] i2c: New mailing list (diff) | |
| download | kernel-b39ad0cf7c19fc14e8f823b1b36245f7a3711655.tar.gz kernel-b39ad0cf7c19fc14e8f823b1b36245f7a3711655.zip | |
[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 <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-pca.c')
| -rw-r--r-- | drivers/i2c/algos/i2c-algo-pca.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index 82946acab4c7..b88a6fcf7bd0 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c @@ -374,10 +374,10 @@ int i2c_pca_add_bus(struct i2c_adapter *adap) adap->timeout = 100; /* default values, should */ adap->retries = 3; /* be replaced by defines */ - rval = pca_init(pca_adap); + if ((rval = pca_init(pca_adap))) + return rval; - if (!rval) - i2c_add_adapter(adap); + rval = i2c_add_adapter(adap); return rval; } |
