From patchwork Fri Aug 12 10:06:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9276671 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 D342560780 for ; Fri, 12 Aug 2016 10:06:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C380F28963 for ; Fri, 12 Aug 2016 10:06:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B80BB28966; Fri, 12 Aug 2016 10:06:29 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E99628963 for ; Fri, 12 Aug 2016 10:06:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B5CE6EAFD; Fri, 12 Aug 2016 10:06:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0089.outbound.protection.outlook.com [104.47.34.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0777B6EAFD for ; Fri, 12 Aug 2016 10:06:26 +0000 (UTC) Received: from BN6PR03CA0043.namprd03.prod.outlook.com (10.175.124.29) by BN3PR0301MB0836.namprd03.prod.outlook.com (10.160.154.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Fri, 12 Aug 2016 10:06:23 +0000 Received: from BY2FFO11FD034.protection.gbl (2a01:111:f400:7c0c::184) by BN6PR03CA0043.outlook.office365.com (2603:10b6:404:10c::29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15 via Frontend Transport; Fri, 12 Aug 2016 10:06:23 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=gmail.com; pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD034.mail.protection.outlook.com (10.1.14.219) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.567.7 via Frontend Transport; Fri, 12 Aug 2016 10:06:22 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7CA6IsL016286; Fri, 12 Aug 2016 03:06:20 -0700 From: Liu Ying To: Subject: [PATCH] drm/imx: imx-ldb: detach existing panels when unbinding the driver Date: Fri, 12 Aug 2016 18:06:05 +0800 Message-ID: <1470996365-4799-1-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131154699826190629; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(189002)(199003)(81166006)(36756003)(5003940100001)(48376002)(305945005)(626004)(8676002)(50466002)(76482005)(105596002)(77096005)(19580405001)(19580395003)(586003)(92566002)(87936001)(81442002)(50226002)(110136002)(97736004)(104016004)(189998001)(7846002)(8936002)(50986999)(87572001)(356003)(81156014)(6260500002)(55446002)(82202001)(229853001)(33646002)(106466001)(11100500001)(86362001)(47776003)(4326007)(2906002)(68736007)(61266001)(2351001)(83322999)(5890100001)(73392002)(73972006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0301MB0836; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD034; 1:WEiEabOpU8WT+YqaPjkN41afbcbGuSc+y7+PMeA+C9pr0fO70rsUjxNJ5KSQ5kg+NUXSRe8hos5emT38LOKsQIsVOoLwqLGyOFMxBs1arqUZi1IC0LNQ/vnrsE2Z3QYR6ARbj7KAujo/iDlgptNyPTHgQWnrHNQzSF3WXjSOsFlQmoYfH4epa1m00dKdMAkZfGylNjog4779FwOVe9ICS+z0pj/CmyeAEgJj5ndryWMAi4TySIJwL7YyFsyn2xhW5XhMnGUSQumPl2L5AohVg7vR+N9pnPnq3IPHisSHkAf763F9ohgnysSXEEmBwTaylTmGDkT2q9kbvNxP9yJpRXmfolG71UMV+5vAzBhi2CdWWkBAO53E+ahhhG4XUa4qJ4+oKnSbfZc/CnISU7XbVz6ntkwFZcLvkTFBznhMYM49QbX6nil56AhOm+xhwOZPnXHlBY6FUKBukoIXfDc4l/BQ3+3VkF+KpQg1LzEDm3pU0HUV8WAed0jtH4ljdzoq3XhxZ1glrwcBHk9mc5BadWbD91ecO/aYTHbcg8OELyU5FXy7Gj94ayZmxUxK8lZofIWanHpQNmTF9/rRDT7O6g== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4963eab2-fdca-4c1e-5925-08d3c298503a X-Microsoft-Exchange-Diagnostics: 1; BN3PR0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change-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13018025)(5005006)(8121501046)(13017025)(13023025)(13024025)(13015025)(3002001)(10201501046)(6055026); SRVR:BN3PR0301MB0836; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR0301MB0836; X-Forefront-PRVS: 003245E729 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB0836; 23:VcSfdlLWV1GMNy5WuoI1cfcY+i47A2NrYGrVuDI?= =?us-ascii?Q?N4dHU3B/0S2ZPlhqjbsSR/B2Hn6hJg3+dq22oid34aC2vEMHitc1WtYaUVPw?= =?us-ascii?Q?Jy48EN1BHcvVWiabdH+tbb3SXtop0GkqMhnXK4DwJT1RsVHkHEWOL08KuUCQ?= =?us-ascii?Q?A1eT6NXQTWWfgO9giOX5251XW8aMTFV2tYzNQR64xqyf0Y4SVg3KDdcRSxyL?= =?us-ascii?Q?xgvRwcc+Vwx2qy3dq1LqeustXVeEM5w5YA5Bc52+1EXNtk1eGdfwnTg00HZM?= =?us-ascii?Q?oNeUp/JaGN817z/NrqBZT7xWw+gAABoiqsBMkOjP3pINrchRAm+0jLdVnJyU?= =?us-ascii?Q?Ngf6BD9oOY9k4MyFCpR3p3LxS/eK47I9ZXt/rPfMbOizqfmbB/s+Uhu6QKA7?= =?us-ascii?Q?zB5pwskTNpyrP/Dva06fKGNDTtwxB44YeNdwut+/bwd9Ra8v+hPIfHuoNq2j?= =?us-ascii?Q?ttrxx6vSU3b/ClkNJuPTvHDpVfuw4pmWdU+LlHT2NaOHJAFV3yGZHpayOwKk?= =?us-ascii?Q?THOiyoeSQEwkqTXRSEhRLHikT88O9I4zAqYBfIoN3vSrExMb/YH3NGYOFD3W?= =?us-ascii?Q?Oe2gOta7QINPs1H88bDAuGwSsVdhZfnOPK/tcL+CodQ0dvoI4OIr45ciHjLl?= =?us-ascii?Q?jG/9X1VQfXPab4L7JA97v5f6nq9SDItS/VpOO51Bo/QGxgiA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hUBAUKTQ65m3iQRpjNvWBFJoU9xX5AZmES5ABSluiueaL65T71I1vYxjJrRsmT6+cDgmQF2mPjA6YMTbFuPJXFxqHzuFVEqOgKvZOeVs175SmrrhqWZGoMIt8PgAI+ILKY158ZruoaEV8xJLA=; 24:A8HbJQGPt1imww5M8U2MVKXOBgGdqMdW2dnSt6M8cSUWzPZnRVjE/nqgPiDGyXYIAHF+hzCAfGEtCrB8sXw0qWgMYnikBIOGhSLPPukgvTE=; 7:fPfhn5hhF2ODfo11jp7t1avx8iDKo4zEu0Jg8msL4H93Ix87FWXKBxJPvwCE+N8q0EKsHrd+GBKvFZrZz0ugDTKSpKheVk7jX3kVSKzayWFpRTAvi92zfUQmvAKpeGa0ubBzUXE4wMgA6qycI7UZ5gNFMCPymmHsnRSHFVM7wBGLNp4qHi1ce0ALQ1hnXb5rGchAQYHVIcnZUXEAbVDNf2GTjTTB9G83Beu2x18dpOFVmPaxpV4ZZBUIWOaK1oN/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2016 10:06:22.4318 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0301MB0836 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP We should detach existing panels when unbinding the driver since they are attached at the binding stage, otherwise, the attaching function would return the -EBUSY value when the ldb driver module is installed again. Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/imx-ldb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 4eed3a6..a22c6f7 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -757,6 +757,9 @@ static void imx_ldb_unbind(struct device *dev, struct device *master, for (i = 0; i < 2; i++) { struct imx_ldb_channel *channel = &imx_ldb->channel[i]; + if (channel->panel) + drm_panel_detach(channel->panel); + if (!channel->connector.funcs) continue;