From patchwork Fri May 4 13:52:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10380525 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39529603B4 for ; Fri, 4 May 2018 13:54:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AB7329455 for ; Fri, 4 May 2018 13:54:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EE5E29456; Fri, 4 May 2018 13:54:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C782945A for ; Fri, 4 May 2018 13:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240AbeEDNyi (ORCPT ); Fri, 4 May 2018 09:54:38 -0400 Received: from mail-eopbgr20104.outbound.protection.outlook.com ([40.107.2.104]:7868 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751833AbeEDNxw (ORCPT ); Fri, 4 May 2018 09:53:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WmoBx/K7uS9baBp7L/9Aw0xoQXZ7OAeeDlPd5qGStmo=; b=Xy8WrXom9p7iNFuZGithywv/dqfsWdPsqZB6DpFATZDGy8cN82s+EpcljAPRX6TNQucl3N7vcokeMP+T1cp7Bjf1dh4clueqe+e4KVvVIl/lF8uUw2yud/UluhKVG3G/yr72hghn9FNS+4eDPFIRViOySUvoRq8567jkgpuwRGA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from orc.pedanet (85.226.244.23) by AM4PR0202MB2769.eurprd02.prod.outlook.com (2603:10a6:200:8c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.735.16; Fri, 4 May 2018 13:53:45 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Cc: Peter Rosin , Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Peter Senna Tschudin , Martin Donnelly , Martyn Welch , Gustavo Padovan , Maarten Lankhorst , Sean Paul , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Kukjin Kim , Krzysztof Kozlowski , CK Hu , Philipp Zabel , Matthias Brugger , Rob Clark , Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Benjamin Gaignard , Vincent Abriou , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Jyri Sarha , Daniel Vetter Subject: [PATCH v2 25/26] drm/bridge: require the owner .odev to be filled in on drm_bridge_add/attach Date: Fri, 4 May 2018 15:52:11 +0200 Message-Id: <20180504135212.26977-26-peda@axentia.se> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180504135212.26977-1-peda@axentia.se> References: <20180504135212.26977-1-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: DB6PR0202CA0039.eurprd02.prod.outlook.com (2603:10a6:4:a5::25) To AM4PR0202MB2769.eurprd02.prod.outlook.com (2603:10a6:200:8c::19) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:AM4PR0202MB2769; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2769; 3:uVpej3n/jhcFWhTGLC5sScv2xdApvjB/xIEeIumpR56ZH9N7V+oeGmSGML15BhWvYpN7/OrHYN2w8BE6wDhCC76oJlSxOcwO531fqoyX+IbdyDuCv5YH2Sf9e388wSxsJOyMqv3u+/ws1IxKfpb3/1SEIFBv3/NXJ5yNRXhAPqxvKbnAc1zqy5RgZa6Yhka8zKz10rOWu/60OeZCB5m5xJMPrxPV4RG/UER8l/lqtWeP6MjjoVwWx/jXV5/awNAF; 25:MR7/rCgi6epME1cxyJ9856FlTmVvBjhWGAin1yVRdq+8SE//O/+l+v515wtgGP6YOPmKau9H/GjJtak+RcmZDt+V23SA6LEcHEkfJ6/EdEvaYwLNKGMPhCnpS8rGwGPAeMXHGM5+3ucORY6JAv+UyIjXtiUYdDNSySGUwagIW0Zo5mvUGHfPN0CGArGJclY3saP0aML7Z7MVRt+Ga65hjooVMzYGMpt32GVVCUTDtm7rSn89PRRwapVsyR5j+mnPrs3aA2gq2SRPuQT0VsHWsIAf2LbdyG7cH5RtUYWNZkFP9+ovNX9YytlqCRhzjN84i1vwkVRqYWjRr4Chkv66MA==; 31:5edPzerELf4vn2gwe9gu5uWprscMcEcmhirzqrd0mLjGrowXSukiwWwoQXShNs/j+Aw34cjtKSSN8tZ24S5caIawgVJ78j/YEIQ5NVC9j1AkO5NkjDGJPtIAryK5Fr4UyGVnsZi52KrPnLkdkaR4a3auj80ZZThXAQ9t+A2Fe7lmxIe/Yb7Dz7ofpaNSrTDkwsC2jSlMvs/cZ4wCxvAqk4atjuJh7ivENuZmutTuK1A= X-MS-TrafficTypeDiagnostic: AM4PR0202MB2769: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6043046)(6072148)(201708071742011); SRVR:AM4PR0202MB2769; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0202MB2769; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2769; 4:CkgOU7ivH/btaiAG4UlbLpM6rz9wNXTBtnpkPvP8N0BVLqiYvwk4CTeLebpZV/8ZSoKh9AGlgMyDO9Wpv5GFtO82xH8pdJO+WPSpZs8uQWRxpFy+U7ZQ8Hh3coWl6g669iHPXZm2mRq164c5wenB9rGSDaIft1XtAIbi2VbkUS2dEHerDzvEx6bWRwUopyE0MWJmyxF4G7HgsaRSJDXTGkMljvb6gSNhgBFb1cNPNbksZuUWhb+V1RyJVK/EQGD+8B19FfYiAGUPlXyhk0krXQ== X-Forefront-PRVS: 06628F7CA4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(1496009)(366004)(39840400004)(39380400002)(376002)(346002)(396003)(199004)(189003)(52116002)(386003)(50466002)(305945005)(6506007)(54906003)(74482002)(316002)(68736007)(5660300001)(16586007)(6666003)(50226002)(7736002)(8936002)(81166006)(8676002)(97736004)(6916009)(1076002)(48376002)(2906002)(2351001)(2361001)(16526019)(81156014)(39060400002)(76176011)(4326008)(86362001)(6486002)(6116002)(3846002)(53936002)(5890100001)(106356001)(478600001)(11346002)(486006)(446003)(36756003)(25786009)(51416003)(476003)(7406005)(956004)(105586002)(2616005)(7416002)(66066001)(6512007)(59450400001)(186003)(26005)(47776003)(142923001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR0202MB2769; H:orc.pedanet; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0202MB2769; 23:hr1ncnP23Rt2XhC83AbIO6eTl9W+PEb4NcMNjWG?= =?us-ascii?Q?282+XdRBz2T9+KGZJq19NQQZHRw/BsFYC2nX/uegpRJTuYnWeFEjZGXR0gPD?= =?us-ascii?Q?MkUfQN1Nxd7d6F7Rciw9aOgli7Uook+xTSWAuhzixbU2faU2R8n29lhHeGdH?= =?us-ascii?Q?VkraFZW+EbAOhIXATBSHjLOqa4xiaYJRuS1EEG044Str0BonaBaJeZb8f6YD?= =?us-ascii?Q?bP06GATOEhkOwe/hokMJ86uhFSvV722IDXL5aNbxw5/Sk/OxBOzdbTFFj822?= =?us-ascii?Q?cXjkHyxw2SW5ypQ8jDCUA+6X184geyb/jJQOzo+5bK7iWyEPb6YLaWPhy3dJ?= =?us-ascii?Q?9OIlBDax2FzzlbUyxTDchJuxzfbepjBO4DsDauTk9DkAHSKgk+4A5pS2HlLE?= =?us-ascii?Q?VE9ZffyYfeICma6cBFmUFh5drU9O2P/5g7epk51kZX4uGkDDoZIyVzHifR5y?= =?us-ascii?Q?O8p4CtHyy3pTGQqvX2DmZGbbhLfH9SKDq16QGq1vFYUsklUoGkqa1rStf3bY?= =?us-ascii?Q?n5uLHZFzorstVqi/HEywwGNsukTAsxgAGXZLy4iLndzqQ+wVEV5qoXqFMXK6?= =?us-ascii?Q?HOeq2mCUQnkiO6GF5+vTfuIv1f9H9HGogAWKbP7e/WIW9Y5f7vHbgtaA94yB?= =?us-ascii?Q?607sq5YgRSiXi9zzXFvYa+SPENmXH6/GKkhUhQDsVS76cbJ89m5nX6A519SF?= =?us-ascii?Q?WOHQlPYIKA7YXH1NVUOMr/J8JrH9gjHN+tKNaVMXI2RY4b4WSCok+jX31P+M?= =?us-ascii?Q?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I4fs3rEx6C+1yMIgsmub03ul6tmX4hkxHY7Y9pr2GzFcIRNZk4sKh7h5cWpZ X-MS-Office365-Filtering-Correlation-Id: 9ce7491c-d39d-46c3-7a6c-08d5b1c6756a X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2018 13:53:45.1607 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ce7491c-d39d-46c3-7a6c-08d5b1c6756a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0202MB2769 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The .odev owner device will be handy to have around. Signed-off-by: Peter Rosin Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/drm_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index df084db33494..78d186b6831b 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -70,6 +70,9 @@ static LIST_HEAD(bridge_list); */ void drm_bridge_add(struct drm_bridge *bridge) { + if (WARN_ON(!bridge->odev)) + return; + mutex_lock(&bridge_lock); list_add_tail(&bridge->list, &bridge_list); mutex_unlock(&bridge_lock); @@ -115,6 +118,9 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, if (!encoder || !bridge) return -EINVAL; + if (WARN_ON(!bridge->odev)) + return -EINVAL; + if (previous && (!previous->dev || previous->encoder != encoder)) return -EINVAL;