Commit e7e0782c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: i2c: tie to the proper place on the greybus_device

parent db6e1fd2
......@@ -107,7 +107,7 @@ int gb_i2c_probe(struct greybus_device *gdev,
i2c_gb_dev->gdev = gdev;
i2c_gb_dev->adapter = adapter;
greybus_set_drvdata(gdev, i2c_gb_dev);
gdev->gb_i2c_dev = i2c_gb_dev;
return 0;
error:
kfree(adapter);
......@@ -119,7 +119,7 @@ void gb_i2c_disconnect(struct greybus_device *gdev)
{
struct gb_i2c_device *i2c_gb_dev;
i2c_gb_dev = greybus_get_drvdata(gdev);
i2c_gb_dev = gdev->gb_i2c_dev;
i2c_del_adapter(i2c_gb_dev->adapter);
kfree(i2c_gb_dev->adapter);
kfree(i2c_gb_dev);
......
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