@@ -313,7 +313,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
if (ddc) {
- panel->ddc = of_find_i2c_adapter_by_node(ddc);
+ panel->ddc = of_get_i2c_adapter_by_node(ddc);
of_node_put(ddc);
if (!panel->ddc) {
@@ -335,8 +335,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
return 0;
free_ddc:
- if (panel->ddc)
- put_device(&panel->ddc->dev);
+ i2c_put_adapter(panel->ddc);
+
free_backlight:
if (panel->backlight)
put_device(&panel->backlight->dev);
@@ -353,8 +353,7 @@ static int panel_simple_remove(struct device *dev)
panel_simple_disable(&panel->base);
- if (panel->ddc)
- put_device(&panel->ddc->dev);
+ i2c_put_adapter(panel->ddc);
if (panel->backlight)
put_device(&panel->backlight->dev);
This change is needed to properly lock I2C bus driver, which serves DDC. On release of_get_i2c_adapter_by_node() requires i2c_put_adapter() call, which replaces put_device(). Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> --- drivers/gpu/drm/panel/panel-simple.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)