Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1396504lqh; Mon, 6 May 2024 06:41:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8SdHcPWH49JzseTk8+lfjOW0b2Ys9vA+L+nu9WhSV2Mu02FUhPQjIokp5LvkPB5wS4gu6WqQ3pI1Yva6Vwe5GWTnLgOGbV8Mlq+9AGQ== X-Google-Smtp-Source: AGHT+IGuAp75kci/q0LfeTZToME/y/iBVk2Cyb/cq1Kb2md9uJALykxL8E10slx56tGZNp9ziejf X-Received: by 2002:a05:620a:1474:b0:792:91e1:2c5e with SMTP id j20-20020a05620a147400b0079291e12c5emr5469252qkl.67.1715002909083; Mon, 06 May 2024 06:41:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715002909; cv=pass; d=google.com; s=arc-20160816; b=gAA0R9JiGwcZFDicPJfsAmGC1yRaVM5WGgH843lg97mZ4lJNjhLaB8biHnZaaJIos+ ylkzMy9QkKDRaCDaRTUxF2GqIRxvIJzarOzh36V3KgET8vPWm6WB92SxJ+C/H3zt/U5c 38OTE/xhZqkDgli3dARyDuJYL+vgu15PsOiR4BKhZJ1Km7z/tqtLk2T8TCy0orR/oKzG VmXGNYQ/VAGBIl8hUkJCAaZmdkfnaukIlnSIE7PyZVidpef6BOSkdFi6NEkT5+04IcL4 MDjqLM9w/np7YOlkB6nxJkBDVPFIoXGBJHFIvjpwOrYiAQ0suuEkLLDyyoMBqzCFox+i FEJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=g/P3I/ez21YDg7amSoWE87jvQjiNSKk7RcYzoeglwgM=; fh=SuRMajwH7N2ZLVBLirbkCwTFKIhKCObxyHKAw4nU6hQ=; b=SKKk75KLCGdRiuoLskjVa9npY4I55Ka3rkRecNw+t3X0/a2DvHntMsmZYkYOIGZ43b O2OV4sXCUGkE6TDPUiBpqHPy6fMy6MMpYULaRx6/EO7B4DZ1yAqcaOr13k+ZGber2VHw 3pME+/2Uyeo48Hh6p+20F/lRRxzZ2uIuoKYUoXO4RjK8kmjoCFhrq/qZEaK/qsA3dOoH RApymQrZ/Lp0Oj/6uWtF+v54pUdrd6ZXCpPMW1Xyl2K7tolEj1QLwduAsrN5yRjBBLjz kNDWwrecyoa+DIbKScEeywLhuhX01ryRMcjWZVqRpanKoGH3RLiPAPQxtwzLRhV8AQAR wAfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DqI6QqBA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y29-20020a05620a0e1d00b00790f91c20a6si8975474qkm.33.2024.05.06.06.41.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 06:41:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DqI6QqBA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CD2D91C212D5 for ; Mon, 6 May 2024 13:41:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7628C12AAF6; Mon, 6 May 2024 13:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DqI6QqBA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A33ED7BB0F for ; Mon, 6 May 2024 13:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002601; cv=none; b=kRq96D285ne2g5YPC/8myY9Hxt1COYT14gr/J7U2kxo3YqD6ADUECkJel7gMwxvT8R8++P/vV1A1fFyNdm+9WjRjdXdg7yEag7gQjKDiSpHJGQTk55uh9lifYnI9C3uCs77dTtxOHVj2XN0CnXhiOv4OLmyQ08u7MJYwacEhdho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002601; c=relaxed/simple; bh=paegLAtAIiOzY5eKQeauNPYuwsGxSeeUGgOBWr0kV1o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jY3LiY6trMQZ4JDEhzgRJCU2Mhe2nUR+ld4Dje6gCpF+VrYvjwC91w1cdP5SCaBZmQ1HYU5Bb1+hmBsHy3X1alTeuadzYiQ0jC5+/UrEhEVMXwvLOD+NQNnapIFdrFwFRRcctK/5MYplWtQv/q4WjRG0AHtQns35q2xLSnT666U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DqI6QqBA; arc=none smtp.client-ip=10.30.226.201 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() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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); -- 2.39.2