drm/panel-edp: take i2c adapter module reference

The i2c subsystem currently blocks during adapter deregistration
whenever there are consumers holding a reference.

Switch to using of_get_i2c_adapter_by_node() which also takes a
reference to the adapter module so that an attempt to unload the module
while in use fails gracefully instead of blocking uninterruptibly.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patch.msgid.link/20260717143119.1815106-3-johan@kernel.org
This commit is contained in:
Johan Hovold
2026-07-17 16:31:19 +02:00
committed by Douglas Anderson
parent e2a9e29127
commit c7b77a538e

View File

@@ -836,7 +836,7 @@ static void panel_edp_put_adapter(void *_adap)
{
struct i2c_adapter *adap = _adap;
put_device(&adap->dev);
i2c_put_adapter(adap);
}
static int panel_edp_probe(struct device *dev, const struct panel_desc *desc,
@@ -881,7 +881,7 @@ static int panel_edp_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)