From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABB4A42A171 for ; Fri, 17 Jul 2026 14:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784298743; cv=none; b=Xp+Vwyf+hrx6qHiM+E4MjZpqdUoKxFFLicB3hiMJnZCxQ9QNxUAku17TR/8IPnaJMgAundSQKZTFZUWoji4JlNtfa3YSdrW71Nz+VZSx0NFsgGR4iomtus9wzcPGjjRAmR/W/f/EYEo8zAqKViK+/RNqt6L0WdEiFXB97ECfm6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784298743; c=relaxed/simple; bh=TVigLrY2IwIhNZ99RvGrxl/ztmu30auY+Wnb/g5LXR0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bGGFrQx/14VVThRpdqqavzSeOnrMd41a8Ejm9Zt9hX/qmPheLXNpw8bvWRMlCD5xyByBVxl1dHLS/IgBcO/Ve2f2giL8LmVeMT5088NvTS3qHH8MEDlGtiZRL1sH3lnSiONIsHnZPreIHcfU6COu8lxU6MIYl52egy4EEkTRnrs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TCtKBw7W; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TCtKBw7W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FCC91F000E9; Fri, 17 Jul 2026 14:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784298742; bh=EWJ6GGiCe+HmzuKwuv1zPKCZtQLuNomeRk/0qeAVPxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TCtKBw7Wd/yj5F+ULu9tBSU6+NyHSFDIh4edpYvBVlEk88YPz1ihn4hdIeeKP6Vhf LhKhKDcq7HXEkCkC5ubC9jSS3tvjdbr7POHjhzY9n04o/wdMkzRzRzlrWEoyioAxfp C2L+unCba2r/ae6cl679PNBIPFuZomMvQ7THtpyyZDwXrb8AIT10df3InvGR/9Njnl xSWhHlhbg9L7sxed0m4tJ0WcPNaHm5gHInBuD7XqyL58Dxib5BzpaK6rWt4TpA4Cal pgNYGsx/SEbYjdHcrUpoNBzEFsO9bnvny70wuLjEbMeRfUQ/L520xKvS9a0sD6GkNd qvS/wDOfd08Tg== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wkjbw-00000007cDF-0rVX; Fri, 17 Jul 2026 16:32:20 +0200 From: Johan Hovold To: Douglas Anderson , Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 2/2] drm/panel-edp: take i2c adapter module reference Date: Fri, 17 Jul 2026 16:31:19 +0200 Message-ID: <20260717143119.1815106-3-johan@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260717143119.1815106-1-johan@kernel.org> References: <20260717143119.1815106-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- drivers/gpu/drm/panel/panel-edp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index ac815729aa83..522bc665a11a 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -835,7 +835,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, @@ -880,7 +880,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) -- 2.54.0