mirror of https://gitee.com/openkylin/linux.git
i2c: remove check that can never be true
A driver remove callback is only called if the device was bound before. So it's sure that both dev and dev->driver are valid and dev is an i2c device. If the check fails something louder than "return 0" might be appropriate because the problem is grave (something like memory corruption), otherwise the check is useless. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
parent
71637c620a
commit
4e970a0ada
|
@ -549,12 +549,9 @@ static int i2c_device_probe(struct device *dev)
|
|||
|
||||
static int i2c_device_remove(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = i2c_verify_client(dev);
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct i2c_driver *driver;
|
||||
|
||||
if (!client || !dev->driver)
|
||||
return 0;
|
||||
|
||||
driver = to_i2c_driver(dev->driver);
|
||||
if (driver->remove) {
|
||||
int status;
|
||||
|
|
Loading…
Reference in New Issue