From patchwork Mon May 6 13:34:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 13655481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2346FC10F16 for ; Mon, 6 May 2024 13:36:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F25C10FD07; Mon, 6 May 2024 13:36:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="DqI6QqBA"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 127EC10FD07 for ; Mon, 6 May 2024 13:36:41 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 73423612B8; Mon, 6 May 2024 13:36:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6D83C4AF63; Mon, 6 May 2024 13:36:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715002601; bh=paegLAtAIiOzY5eKQeauNPYuwsGxSeeUGgOBWr0kV1o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DqI6QqBAEh0SLMoX6jxGMlYEF7hX2qBs28XSz8VMiI1jujVuLsNYoAqiEcAspAaz4 Zyp+ea/4k4F9fQg4bs2/DWeuY4Yc/FWTDEInQn8XN1MgHgpeGwF8VYsX1NeIcs6ivM xQ3sJb4SWDoKdOYIC80ppCzDUcx7HYU8Ig8tmph0+spRJzQziEZeyuPuySnCn3hxJS OEMPgZx4Bejm8cLNBMRfkb/Oyfu+1rxtZYXfsR82ol9U4DF4tPlZsBEWbTCONNoGq+ +bLz1C7cSHzISiOvmcR+xzL93l5nKPDCoOcpVQgg1xR0NePq2Uj5hlocb3aP95yCM4 eZGn1TO44UzPQ== From: Michael Walle Date: Mon, 06 May 2024 15:34:49 +0200 Subject: [PATCH 20/20] drm/bridge: tc358775: use devm_drm_bridge_add() MIME-Version: 1.0 Message-Id: <20240506-tc358775-fix-powerup-v1-20-545dcf00b8dd@kernel.org> References: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> In-Reply-To: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sam Ravnborg , Vinay Simha BN , Tony Lindgren Cc: Daniel Semkowicz , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.4 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the device resource managed version of drm_bridge_add(). This simplifies the error handling and we can get rid of tc_remove_bridge(). Also, add a check for the return code. Signed-off-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c index 31f89b7d5a3a..1d2547e4c4e3 100644 --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -762,26 +762,14 @@ static int tc_probe(struct i2c_client *client) tc->bridge.funcs = &tc_bridge_funcs; tc->bridge.of_node = dev->of_node; tc->bridge.pre_enable_prev_first = true; - drm_bridge_add(&tc->bridge); - i2c_set_clientdata(client, tc); - - ret = tc_attach_host(tc); + ret = devm_drm_bridge_add(tc->dev, &tc->bridge); if (ret) - goto err_bridge_remove; - - return 0; - -err_bridge_remove: - drm_bridge_remove(&tc->bridge); - return ret; -} + return ret; -static void tc_remove(struct i2c_client *client) -{ - struct tc_data *tc = i2c_get_clientdata(client); + i2c_set_clientdata(client, tc); - drm_bridge_remove(&tc->bridge); + return tc_attach_host(tc); } static const struct i2c_device_id tc358775_i2c_ids[] = { @@ -805,7 +793,6 @@ static struct i2c_driver tc358775_driver = { }, .id_table = tc358775_i2c_ids, .probe = tc_probe, - .remove = tc_remove, }; module_i2c_driver(tc358775_driver);