From patchwork Tue Jul 25 07:32:27 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: 125409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2318340vqg; Tue, 25 Jul 2023 01:21:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlHehFz5wV7c2GG3dyk06qxLXceIWBM/ZwfvSf93ZpY0LNaCz24IEDWp9I0kH/0GlWL3kvU/ X-Received: by 2002:aa7:c1c4:0:b0:521:d23d:6850 with SMTP id d4-20020aa7c1c4000000b00521d23d6850mr9760377edp.21.1690273286195; Tue, 25 Jul 2023 01:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690273286; cv=none; d=google.com; s=arc-20160816; b=bpqMOS98MQy2rCv4LqRiM4UwBa5R9DS0Kkva2JStuIdt+Gjj4wBfmMy2PoE7UIFNbV fUMfg11aiGizUQI0HgBC96eS7nf7GxjCnqzO2bmB9DATsnAwlA5zhtaYuJDbLMxn0ZQB Hy7oYkZ/ELD/JlGLayX/zEv7iALpbG8VLDmyu6Dmnat2QPq7qohODWKeHCAOAqb8YnQ6 epRgipqL2JVwK7SXamT1jXWEkayww5A0yYBcdVZ0BVuhz8K2RxFOcWygJA9Q1Dw3V0R/ QP+UR86McjR/1e7OLwtN6Om8aMypEr4jFzw+TJYyMXerYA+JBPmDtV3Yh5gQj3sVf455 aoRA== 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=r3m9dehyH8Rtz4oVGFLM78qV8f+b2gqWRCsZJmYgouc=; fh=WlmesBPh9vy2WAKH+Oa8Mq1mzTGfSQhQroZj01YJT/8=; b=qGOie1SZ9trimB+l6y1ds6Zm3hwXAm9FE4DHEf2YM6WjxZmSKpu17j0N/JY0fI1bUo Wt08w62euFwXnnxYqaEoXtup5H8y89ej0yc466t2BSGbMOS4Gg7LUC9Ggd+ZfHpaFJE1 cvemvD55ll26xZyYxQSRFmTUN9x5eVQhjXMfV6zMsdZ2b/8cP3V/tKpRelgHzj6YxtVm uV+eOMpeFnnhQbMvOvVCwfRH8qOi6c3/uHdsu2LsRbSS3MiFpMCfyfMHkqJMkcalI6+l 4bKLgeKPhzx8c2XXxBnWGfdNSK1oFiPcezLMNX8wh1z45LUTQef9H0l2hlEJVmn4yG5C xLqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=WSi16ofM; 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 n24-20020a056402061800b0052229b772edsi3316397edv.120.2023.07.25.01.21.02; Tue, 25 Jul 2023 01:21:26 -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=WSi16ofM; 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 S232683AbjGYHfH (ORCPT + 99 others); Tue, 25 Jul 2023 03:35:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232328AbjGYHeK (ORCPT ); Tue, 25 Jul 2023 03:34:10 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53ED41BF6 for ; Tue, 25 Jul 2023 00:32:51 -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 7024D6607108; Tue, 25 Jul 2023 08:32:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690270370; bh=dr99OhwRka0b6+lAYNS1mwFM6qaBC8ZcI/J5NoLdlok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WSi16ofMtB8ehG3tBUD1CVjNeDNuqYAfS2USiOTgz8qYecdNQfzoPsjhIAuE8tGFM OQ8+y0S+IVKN2oTWSZWU7qQNESjNmiSmb5+mNl8Ot1dm6CjNjLRk7NAQW1LpspsdDN xXtojEbHdmtddg+K5E3VJVCiS/p181DbTFD9bAj6/8atOtdzi4b02WFRH7A66rZc/Q tR00Fh0S2hQnB9FB0aiTZbZPBNSP+dJfBLBqXHSy6FLUUSmKVtUlRNK2UCkp7akazj VZQaBZSo3Nib7cqzHrDf2nbTbvrLsXNDmseskscPM/FYqVf14iYncSdMDoQmwzQk5p KV2WAgO/Z8JVA== 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, ehristev@collabora.com, CK Hu , Alexandre Mergnat Subject: [PATCH v7 04/11] drm/mediatek: dp: Use devm variant of drm_bridge_add() Date: Tue, 25 Jul 2023 09:32:27 +0200 Message-ID: <20230725073234.55892-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725073234.55892-1-angelogioacchino.delregno@collabora.com> References: <20230725073234.55892-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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: 1772380001725520962 X-GMAIL-MSGID: 1772380001725520962 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);