[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>
This commit is contained in:
Mark M. Hoffman
2006-07-01 17:16:06 +02:00
committed by Greg Kroah-Hartman
parent 5d925fecac
commit b39ad0cf7c
5 changed files with 11 additions and 14 deletions

View File

@@ -479,9 +479,11 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap)
adap->timeout = 100; /* default values, should */
adap->retries = 3; /* be replaced by defines */
rval = pcf_init_8584(pcf_adap);
if (!rval)
i2c_add_adapter(adap);
if ((rval = pcf_init_8584(pcf_adap)))
return rval;
rval = i2c_add_adapter(adap);
return rval;
}