Commit 4e970a0a authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Wolfram Sang

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 71637c62
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment