From patchwork Mon Jul 17 14:14:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 121383 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1157853vqt; Mon, 17 Jul 2023 07:48:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFC05fPwwRmZg8Js+unB47kdrUUD9xLZIfH1IgeRj8lqxcBzmEPfseDIDmO9eo5S3Zbp0QR X-Received: by 2002:a17:906:e285:b0:98e:1156:1a35 with SMTP id gg5-20020a170906e28500b0098e11561a35mr9786514ejb.74.1689605338691; Mon, 17 Jul 2023 07:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689605338; cv=none; d=google.com; s=arc-20160816; b=eHiRt8P1Ro60xBHDTfK9PV8Cw46hpZarIClvnwAwI4anv3wzRtQpUIlaI+ijvCNUFi AcG2N4b6ne8SWRd9Qmxbarp/ylH5X5dArQUUCV8rBsSSxO3DG9MbBdOnWggwcHeUR1WE rvRZQIn6a87dh2HHY+KEZEQ8CCC0fzwxLrzaTmhvxIDyEpTuhrF3nCyGkzeBLEvOnmgw Cx1sY8fZDSaWF9nl6AyMYOEw5WEx/kzIw/r4/y6K73krM7AGveBR7IYFf9Aj0U/yHdW0 l9tR/5afUBPp38G/7MtbP1l9aWL0PeAnUTp0PapQZTsS6SXf6g1nexScCSvPSK7m3bCM pwzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0MjUnietRtdUCCOOY5S/Zbo7jE60Qoa8gh4DcgGopSA=; fh=JpmmvsKbFEtjFcPhKwAU/TS0J6xmkcPCzvp06hVht3s=; b=rIaaeBZY8HGJvAMCVHqVnGHh416tHMUSVXZWh6xpYF8qy6KKqjQhOOW1VLTbCuTnGA EZ5SwOwpFeZc106dBWebedfcvPF/Agu6lQoMRhjUOWP3pIJp5usU5rytjmCZKw0d/UEA /tPoIDSHlg77H3e6+pSrS5WByEu0MkM+931UZTqVrKhth2qs6WMwjDbqwBsOxhiDf9aW JvX9GMN60C4F0N9twmoaqUINr2RruOEWRRd+bch0PwIFfRbxf/+6mf/pPR9cre1l9O06 cYqXpzu/mzDTc1FZNbnqIZAAnHLp/WECn/5i3Wutm0xpdOX0h8n25LstADBm7sVMy5Yr uSoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TEAZ+Mw7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl13-20020a170906e0cd00b00988b6ffa850si5024903ejb.1028.2023.07.17.07.48.33; Mon, 17 Jul 2023 07:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TEAZ+Mw7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232211AbjGQOPK (ORCPT + 99 others); Mon, 17 Jul 2023 10:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbjGQOOx (ORCPT ); Mon, 17 Jul 2023 10:14:53 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3412110DC for ; Mon, 17 Jul 2023 07:14:48 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 40955660704F; Mon, 17 Jul 2023 15:14:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689603286; bh=/3/hDApoGip9KgA24giYtGjKuPsuwiHLKhNDIhX3IrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TEAZ+Mw7aQDJ7EeFlCX9PUS94xqJLzlpVs3cPoOIoS/zjxMAJY44dohP0ujdT1wtF cocicOiXL69l3rb/iK//af7ANn30ryGnRJ0L6Y/OGL5cPhVroEX58SfPQWKInoP/lU cOiYE/KbSHhFr59Wuwvi7t/P1CeodDkHqb7r2VrExMRdqflGAHqK1UcjF2PffmhSIp 429P/EPA5eHmL5qvZScN9EVQrIKggg6BVdSqLzzvQJUtsjQMbNKK8DbqS5oJ/ip43P a/YgdhmB2VpPcWFTLo4NyMHjhOHhyU1LUzoG8gg1CPBJzCtlZnk89nzBIWn8kvB/Ub /k0acbDf4KIDA== From: AngeloGioacchino Del Regno To: chunkuang.hu@kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, wenst@chromium.org, nfraprado@collabora.com Subject: [PATCH v6 04/11] drm/mediatek: dp: Use devm variant of drm_bridge_add() Date: Mon, 17 Jul 2023 16:14:31 +0200 Message-Id: <20230717141438.274419-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230717141438.274419-1-angelogioacchino.delregno@collabora.com> References: <20230717141438.274419-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771679607768404200 X-GMAIL-MSGID: 1771679607768404200 In preparation for adding support for aux-bus, which will add a code path that may fail after the drm_bridge_add() call, change that to devm_drm_bridge_add() to simplify failure paths later. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai Reviewed-by: CK Hu Reviewed-by: Alexandre Mergnat --- drivers/gpu/drm/mediatek/mtk_dp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 98f63d8230e4..fc6cabf5370b 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -2552,7 +2552,9 @@ static int mtk_dp_probe(struct platform_device *pdev) DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD; mtk_dp->bridge.type = mtk_dp->data->bridge_type; - drm_bridge_add(&mtk_dp->bridge); + ret = devm_drm_bridge_add(dev, &mtk_dp->bridge); + if (ret) + return dev_err_probe(dev, ret, "Failed to add bridge\n"); mtk_dp->need_debounce = true; timer_setup(&mtk_dp->debounce_timer, mtk_dp_debounce_timer, 0); @@ -2570,7 +2572,6 @@ static int mtk_dp_remove(struct platform_device *pdev) pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); del_timer_sync(&mtk_dp->debounce_timer); - drm_bridge_remove(&mtk_dp->bridge); platform_device_unregister(mtk_dp->phy_dev); if (mtk_dp->audio_pdev) platform_device_unregister(mtk_dp->audio_pdev);