From nobody Thu Sep 24 18:37:40 2026 Received: from mail-wm2-f13.google.com (mail-wm2-f13.google.com [74.125.225.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C31082D73B8 for ; Mon, 21 Sep 2026 13:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789996733; cv=none; b=iXipE/9mY9AicfBxFytiDIWkwj1yggva9PGUxGpghoDIDIX8evoGggt+Elvy+kK/gOpZuHAP0ONrQHdQYzRO4+70LMyAhs++E5F8NdPlprFLFYApAN72gdgm2TGD42wDRAqB4Sb//PI5dcNxqMhDc5obZPmdh0Bh7z7inH7k6Eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789996733; c=relaxed/simple; bh=jZuypoR3MOk4j8mwbMkBfCH9ChVQWIYrvhrSN9ratfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hzGrlYd1kusE/PaLvjOxw9KB/tf46KosYNLe3+6Kc2Qn+ngj1KZ2vWDTGD06slZiYN4p89wRbr5LMY0UhbuicISvC+wg6loaJICkhyJWQHIeWQRMEO+DT7GAn12GT7xEyBtIonv3u/F0kPrK8VEYYhrVtKJPWtSc7QRwvuSmXEU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c6OyIMIs; arc=none smtp.client-ip=74.125.225.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c6OyIMIs" Received: by mail-wm2-f13.google.com with SMTP id 5b1f17b1804b1-49d097b4939so15231395e9.0 for ; Mon, 21 Sep 2026 06:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789996730; x=1790601530; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pBUilLABy+haqxmyNuDtxCS558jv0OslZcYLXXiBzgY=; b=c6OyIMIsGe05AHzfBsd4SD78J33jAz/dhmlLCiGZp03z/o4Y8SRRGr1D005P1zpc7c y+C3nb+5NodzcO8/bkTYrcTXaHzbgKY7qfE7PaJSoQMmiTem5e5Mdmo0oUwSK33Pjqvx EGKhZbtdmlbbQ/Pd7wa6Wa94CANgzS8OQSJ85l5+MmV7cvGz81sFrjLTc/JNX5D/jBqc LIUYf6RgALEs3RGEBd66U6faJDR1xbtPFTnMLggR7EAt55TO/CvBKUyDU/ADGlywYR2c U9xD9AqEp1QTOOUK9kaGQ20xkFyh8eUBbi8KItptZGcNdpEhZO7GS8smN4wYIU8iyMGV be2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789996730; x=1790601530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=pBUilLABy+haqxmyNuDtxCS558jv0OslZcYLXXiBzgY=; b=xJQTM46XrDQFtlrmLQbpCEXO6Xx8G3I7MAU9g94JwdA4JNDguxC32Kkqi+DjAcUCFG E2CbrTiLl0fqIF+5fa4L0eSru6KT4So2zUz3vUxUHMXtfhtJQGcf1YI5oRo32IIrvZuF wj30H2KaV1nFGgzgSTH4aUTOJ0DYflg2x3fncLiv2XhIrY3ZhGnrR4g6afsxFfZznHZd R2cj9TYL9einDNabyfoNIy3PbZlr5nV4dxgqKkFBxZYobyXcnbPoTSEJxwcEsJpVE+yt Dw+LYr8MgHg9cnAIXuY5KOt7WbZxmszqLh+D9OTBXmn+OErLox+W/5IcvUM7k8eg15qC qXaA== X-Forwarded-Encrypted: i=1; AKwUvBxy/HyKu9IXq1rBvnJgqQUHQjAaxMLrw1hgwyQapBqYVhTnQBfTudJUmrG/AcHcBYXJorF0cxGEf3KnB98=@vger.kernel.org X-Gm-Message-State: AFuF++m2NsmsGIZAwqzucBQ/q3bMHOuLGH2heZUVv+0JmQBmCfSjaJXl 519vpgVJRFW4uvuMg46rnLpwximLCF8Qm0OdPahFJsy/oBsEE4n1fkPc X-Gm-Gg: AYBFou27YEowVYe3A7ys9YrXN2KEkv9+X5f3tkBn/z2Bq/Sh+TCDnXKM9J0QD7oNhm2 F4owwZu0pQl6EtiW3ywy+4wJEg0oqKByWPUsIiFLCMiX6FmEN8S6d5Wpg4N2pGbil0O0Y2I/HGA 5W3RKaHUoWJRBKqM2LgZano2e7+0Kj1xRFSPvC+OGv+VGrCWJAseVnX054ypZ2t+2qkPzgO8WpQ 1t12tfZbS6qit0HtkzP80KIVskETBXWXO7BmX+xpngHp/uskdFB3rt9uJwDE0mB91WPQiUAkTz0 TBSGczZMEpxoj4KahhoqFtgCIz3aS73n5bwHSisp11r80ot6y+PZOkId68OYVDsmFx68d250mZb KtY6pp7ox6N13o4HBsIDNsJOnPJ66xilfj+ApcS01yds1J9u/nRSjoDM1VUxe/2iyhE8bs4w8ka Z3uR8QOYU218rIZSAM8WDKYBb/xPtj9pYBknFQB5MF0SJKbFfIN6aVJzjT6UgLG1fcYbdymqknM ETU38EWBamk75Lifa8DbuBlOcOfZ0RRfQ== X-Received: by 2002:a05:600c:c1c8:10b0:49e:81a7:9fbc with SMTP id 5b1f17b1804b1-49fc574aacbmr107980195e9.24.1789996729754; Mon, 21 Sep 2026 06:18:49 -0700 (PDT) Received: from osama.. ([156.223.80.28]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48724460978sm22198797f8f.11.2026.09.21.06.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 06:18:49 -0700 (PDT) From: Osama Abdelkader To: Luca Ceresoli , Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jerry Han Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jessica Zhang , Osama Abdelkader Subject: [PATCH v7 1/3] drm/panel: Use devm_mipi_dsi_attach in BOE panels Date: Mon, 21 Sep 2026 15:17:55 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the managed MIPI DSI attach and panel add helpers in BOE panel drivers and drop the corresponding manual detach and panel remove calls from remove paths. Signed-off-by: Osama Abdelkader --- .../gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 19 ++++----------- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 23 ++---------------- drivers/gpu/drm/panel/panel-boe-td4320.c | 23 ++++-------------- .../drm/panel/panel-boe-th101mb31ig002-28a.c | 24 ++++++------------- .../gpu/drm/panel/panel-boe-tv101wum-ll2.c | 23 ++++-------------- .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 24 ++----------------- 6 files changed, 25 insertions(+), 111 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c b/drivers/gpu/d= rm/panel/panel-boe-bf060y8m-aj0.c index 84c21c62a43e..e9519923c6d8 100644 --- a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +++ b/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c @@ -357,9 +357,11 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_devi= ce *dsi) return dev_err_probe(dev, PTR_ERR(boe->panel.backlight), "Failed to create backlight\n"); =20 - drm_panel_add(&boe->panel); + ret =3D devm_drm_panel_add(dev, &boe->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { dev_err(dev, "Failed to attach to DSI host: %d\n", ret); return ret; @@ -368,18 +370,6 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_devi= ce *dsi) return 0; } =20 -static void boe_bf060y8m_aj0_remove(struct mipi_dsi_device *dsi) -{ - struct boe_bf060y8m_aj0 *boe =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&boe->panel); -} - static const struct of_device_id boe_bf060y8m_aj0_of_match[] =3D { { .compatible =3D "boe,bf060y8m-aj0" }, { /* sentinel */ } @@ -388,7 +378,6 @@ MODULE_DEVICE_TABLE(of, boe_bf060y8m_aj0_of_match); =20 static struct mipi_dsi_driver boe_bf060y8m_aj0_driver =3D { .probe =3D boe_bf060y8m_aj0_probe, - .remove =3D boe_bf060y8m_aj0_remove, .driver =3D { .name =3D "panel-sw43404-boe-fhd-amoled", .of_match_table =3D boe_bf060y8m_aj0_of_match, diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm= /panel/panel-boe-himax8279d.c index 4a8560b4b899..facf37bd1c14 100644 --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c @@ -851,9 +851,7 @@ static int panel_add(struct panel_info *pinfo) if (ret) return ret; =20 - drm_panel_add(&pinfo->base); - - return 0; + return devm_drm_panel_add(dev, &pinfo->base); } =20 static int panel_probe(struct mipi_dsi_device *dsi) @@ -881,23 +879,7 @@ static int panel_probe(struct mipi_dsi_device *dsi) if (err < 0) return err; =20 - err =3D mipi_dsi_attach(dsi); - if (err < 0) - drm_panel_remove(&pinfo->base); - - return err; -} - -static void panel_remove(struct mipi_dsi_device *dsi) -{ - struct panel_info *pinfo =3D mipi_dsi_get_drvdata(dsi); - int err; - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); - - drm_panel_remove(&pinfo->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver panel_driver =3D { @@ -906,7 +888,6 @@ static struct mipi_dsi_driver panel_driver =3D { .of_match_table =3D panel_of_match, }, .probe =3D panel_probe, - .remove =3D panel_remove, }; module_mipi_dsi_driver(panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-boe-td4320.c b/drivers/gpu/drm/pan= el/panel-boe-td4320.c index 23558a76dd72..73b762817e3e 100644 --- a/drivers/gpu/drm/panel/panel-boe-td4320.c +++ b/drivers/gpu/drm/panel/panel-boe-td4320.c @@ -202,29 +202,17 @@ static int boe_td4320_probe(struct mipi_dsi_device *d= si) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - } =20 return 0; } =20 -static void boe_td4320_remove(struct mipi_dsi_device *dsi) -{ - struct boe_td4320 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id boe_td4320_of_match[] =3D { { .compatible =3D "boe,td4320" }, { /* sentinel */ } @@ -233,7 +221,6 @@ MODULE_DEVICE_TABLE(of, boe_td4320_of_match); =20 static struct mipi_dsi_driver boe_td4320_driver =3D { .probe =3D boe_td4320_probe, - .remove =3D boe_td4320_remove, .driver =3D { .name =3D "panel-boe-td4320", .of_match_table =3D boe_td4320_of_match, diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers= /gpu/drm/panel/panel-boe-th101mb31ig002-28a.c index a70a2e58f88c..c5f18e310b43 100644 --- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c @@ -391,25 +391,16 @@ static int boe_th101mb31ig002_dsi_probe(struct mipi_d= si_device *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); - - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - dev_err_probe(&dsi->dev, ret, - "Failed to attach panel to DSI host\n"); - drm_panel_remove(&ctx->panel); + ret =3D devm_drm_panel_add(&dsi->dev, &ctx->panel); + if (ret) return ret; - } =20 - return 0; -} - -static void boe_th101mb31ig002_dsi_remove(struct mipi_dsi_device *dsi) -{ - struct boe_th101mb31ig002 *ctx =3D mipi_dsi_get_drvdata(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); + if (ret < 0) + return dev_err_probe(&dsi->dev, ret, + "Failed to attach panel to DSI host\n"); =20 - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); + return 0; } =20 static const struct of_device_id boe_th101mb31ig002_of_match[] =3D { @@ -431,7 +422,6 @@ static struct mipi_dsi_driver boe_th101mb31ig002_driver= =3D { .of_match_table =3D boe_th101mb31ig002_of_match, }, .probe =3D boe_th101mb31ig002_dsi_probe, - .remove =3D boe_th101mb31ig002_dsi_remove, }; module_mipi_dsi_driver(boe_th101mb31ig002_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c b/drivers/gpu/d= rm/panel/panel-boe-tv101wum-ll2.c index 20b6e11a7d84..8a6c4d5c6320 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c @@ -198,29 +198,17 @@ static int boe_tv101wum_ll2_probe(struct mipi_dsi_dev= ice *dsi) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - } =20 return 0; } =20 -static void boe_tv101wum_ll2_remove(struct mipi_dsi_device *dsi) -{ - struct boe_tv101wum_ll2 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id boe_tv101wum_ll2_of_match[] =3D { { .compatible =3D "boe,tv101wum-ll2" }, { /* sentinel */ } @@ -229,7 +217,6 @@ MODULE_DEVICE_TABLE(of, boe_tv101wum_ll2_of_match); =20 static struct mipi_dsi_driver boe_tv101wum_ll2_driver =3D { .probe =3D boe_tv101wum_ll2_probe, - .remove =3D boe_tv101wum_ll2_remove, .driver =3D { .name =3D "panel-boe-tv101wum_ll2", .of_match_table =3D boe_tv101wum_ll2_of_match, diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/d= rm/panel/panel-boe-tv101wum-nl6.c index 150dff3ab6c3..cf9f15fae272 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1736,9 +1736,7 @@ static int boe_panel_add(struct boe_panel *boe) boe->base.funcs =3D &boe_panel_funcs; boe->base.dev =3D &boe->dsi->dev; =20 - drm_panel_add(&boe->base); - - return 0; + return devm_drm_panel_add(dev, &boe->base); } =20 static int boe_panel_probe(struct mipi_dsi_device *dsi) @@ -1765,24 +1763,7 @@ static int boe_panel_probe(struct mipi_dsi_device *d= si) =20 mipi_dsi_set_drvdata(dsi, boe); =20 - ret =3D mipi_dsi_attach(dsi); - if (ret) - drm_panel_remove(&boe->base); - - return ret; -} - -static void boe_panel_remove(struct mipi_dsi_device *dsi) -{ - struct boe_panel *boe =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); - - if (boe->base.dev) - drm_panel_remove(&boe->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static const struct of_device_id boe_of_match[] =3D { @@ -1820,7 +1801,6 @@ static struct mipi_dsi_driver boe_panel_driver =3D { .of_match_table =3D boe_of_match, }, .probe =3D boe_panel_probe, - .remove =3D boe_panel_remove, }; module_mipi_dsi_driver(boe_panel_driver); =20 --=20 2.43.0 From nobody Thu Sep 24 18:37:40 2026 Received: from mail-wr2-f12.google.com (mail-wr2-f12.google.com [74.125.225.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E682D49BD94 for ; Mon, 21 Sep 2026 13:19:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789996752; cv=none; b=jIFNfDbqB5JM6v8WCH93VFeKBmiJOTPU6I2iauFcKYwLzjtHp2yd2zkrwtY/zdLYxyvniPHBmrMFC6Pm77q5DaFZqPhEJpv87WoiFC31CJJdvmq0wE7p5zI8joFGvIGkIJRivdRLIT2dhkFxN1ith7iRCt7r/nZPhb9dSpWeQow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789996752; c=relaxed/simple; bh=sNysPI4cYYPHrZiQyC/ehfqych5/W+0Z8YOhjZiLKKA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jRW9Fye/sqlpWGsq/tjyL/aVU9779qqanHNT/1n7KLqKu1Lt45XZrEKqbtx+zrHhg+BN+0HGR5Kh0euywPcdY1T+iVpfBvrBt4+MX7ub87jNr+MEvulJjTRo1elCX7Dmzy7KnyVwIc+7VMtuEmTX8jhkI1wiZ6kzkpFg42bntvA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dYg3vVN6; arc=none smtp.client-ip=74.125.225.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dYg3vVN6" Received: by mail-wr2-f12.google.com with SMTP id ffacd0b85a97d-4843f22dcb8so1951743f8f.0 for ; Mon, 21 Sep 2026 06:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789996748; x=1790601548; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WBJLa2aJjw7TBYT1KdM93L6LJC/yf6Je94tOEx2rVZw=; b=dYg3vVN6duQRgdbLGBPU3FZcPx8DQNBoVRngpfOu4iCQk30jXrAI3g8VOJ65v4tVH9 KmoUzanYiz7HUeisckQNB37rBq+ws35NV7VH0L6e3NN4mgj8oRZiPFeVI4dciQgAxina BPBoirojIoPDPG8RZXCjFedKk1tnCUR/+sjgestCWno26QUIVHLQ2cKqQG+V+2BDYdWM olfYY8NjzE39TIIiM19orRyiBg5DTpydGXAUnoz0qw11M16/4BK/9NzoU/VAOdc2DFdD 9IrDagHPsTpRs8cH0v1AHHUxP2Y57Z1hOw+yLZFz/Y9Zd5SBGHcOZoabPtgI0t94j1zG evkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789996748; x=1790601548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=WBJLa2aJjw7TBYT1KdM93L6LJC/yf6Je94tOEx2rVZw=; b=Gl/Jhvg3FDx5PmL3SxGh923lvbRqIRs8oeXJzfNqPhOb3e0kP7BBR62xnV7kBYhcgb TF6o9QdQNg0bjUsX+OzO/GWLEzmGQbX1W3z3XLAQ8QrvVm8r8lsSzlCL7bQer6nF2gXq OyamoHkvFQlIRkPSlEgUiwTTfJG1q0Bvq38msl/pTCuAhnR9x4r+i6Z2XkG5EDaqabDj N81Ogmwx8VRHAhF00IvAaZMF5z5AGohTq7mf7recbOY84j+hFHZH7oAOII2bhtsphZU7 2eBKOVHNV6gxyRNt542iXyaitAbO5D/z2aKqAnZUrv3+fyfMK1rAWEkwNvYp+zdQFQSZ q9eg== X-Forwarded-Encrypted: i=1; AKwUvBwj/1wZ4navlIz775ITSxgXSU8gWdC3aGBYskB/7D0HEmllQpwXCB8uxYLPM5JKfHzN6rPefROCdoQaXm4=@vger.kernel.org X-Gm-Message-State: AFuF++lW4r7P8zZleFOFHPEGCeE26j25xFl8JEcqjrm3nV2etj7OWLDW K0lujtu+JCsNRyulRTVG7YcvBVgBbwljCZUsuekEit9uCHLTHhqqwum/ X-Gm-Gg: AYBFou0ypYdaTWHwzkpVGbpsUz13vS542cv0JQEoqL89hLTWqYcloyTgGoYDqJ/rLgU lLhs+IPUFEkZeL5yEOioqkW4Ounjrg9h5JMn8zJ2g//1sLbcZwExUB8GQ8UrGEzCR+s2KiXi1c+ XG8fK4kJZYFWfmLDMf3Yfu0XcidlBqKiYYgEBzlcik0VmxeE/03vUZoWtNloSkIG23H+ljcwF/7 h/zybHjT0YFx9it/1tptqKW3WQoGE5C4x+/h4wah0T9rbBocsa17ydSNgLFZzLsvb8uM35AdCWv +0V0gOxk4QGe4iep7NIKqaZ+TDvamH/OeqpaZb5/UlSsXE56vXFz2hxuSLeKbbq3j/CqmWX0g8i +TBdqpY9Dyr7CAB1MCBs3tx90d+x748Hgc3hi9UpLAvxFv8ILggrLITSna0tZjVuwbFGCfRfDIk rI5j223QFheaczhxqpLQKpbSY28YtPeLV30z+YfCjPoAZQrpE271nDVbyuTXGoH0FHhpHfCS7ux zmo4+Ck/lYsIxFzaSiynp7LYvqAL573HA== X-Received: by 2002:a05:6000:4287:b0:485:8f2e:75ba with SMTP id ffacd0b85a97d-4871e269e82mr15123057f8f.34.1789996747751; Mon, 21 Sep 2026 06:19:07 -0700 (PDT) Received: from osama.. ([156.223.80.28]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48724460978sm22198797f8f.11.2026.09.21.06.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 06:19:07 -0700 (PDT) From: Osama Abdelkader To: Luca Ceresoli , Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Linus Walleij , Cristian Cozzolino , Sumit Semwal , Krzysztof Kozlowski , Robert Chiras Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jessica Zhang , Osama Abdelkader Subject: [PATCH v7 2/3] drm/panel: Use managed helpers in Novatek and Raydium panels Date: Mon, 21 Sep 2026 15:17:56 +0200 Message-ID: <66eccc200bb4f5e26a3464a46448b1a4c03b53a6.1789994813.git.osama.abdelkader@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the managed MIPI DSI attach and panel add helpers in Novatek and Raydium panel drivers and drop the corresponding manual detach and panel remove calls from remove paths. Suggested-by: Luca Ceresoli Signed-off-by: Osama Abdelkader --- v5: - nt35510: keep manual attach/detach; remove() powers off after it. (Luca) v4: - Use devm_drm_panel_add() instead of drm_panel_add(). drivers/gpu/drm/panel/panel-novatek-nt35510.c | 13 ++++++---- drivers/gpu/drm/panel/panel-novatek-nt35532.c | 23 ++++------------- drivers/gpu/drm/panel/panel-novatek-nt35560.c | 19 +++----------- .../gpu/drm/panel/panel-novatek-nt36672a.c | 25 ++----------------- .../gpu/drm/panel/panel-novatek-nt36672e.c | 21 ++++------------ .../gpu/drm/panel/panel-novatek-nt37700f.c | 23 ++++------------- drivers/gpu/drm/panel/panel-novatek-nt37801.c | 23 ++++------------- drivers/gpu/drm/panel/panel-raydium-rm67191.c | 22 +++------------- drivers/gpu/drm/panel/panel-raydium-rm67200.c | 23 ++++------------- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 16 +++--------- drivers/gpu/drm/panel/panel-raydium-rm692e5.c | 20 +++------------ 11 files changed, 49 insertions(+), 179 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/dr= m/panel/panel-novatek-nt35510.c index 3189d89c7ca0..86d1a19afb7b 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c @@ -1173,11 +1173,13 @@ static int nt35510_probe(struct mipi_dsi_device *ds= i) nt->panel.backlight =3D bl; } =20 - drm_panel_add(&nt->panel); + ret =3D devm_drm_panel_add(dev, &nt->panel); + if (ret) + return ret; =20 ret =3D mipi_dsi_attach(dsi); if (ret < 0) - drm_panel_remove(&nt->panel); + return ret; =20 return 0; } @@ -1187,13 +1189,14 @@ static void nt35510_remove(struct mipi_dsi_device *= dsi) struct nt35510 *nt =3D mipi_dsi_get_drvdata(dsi); int ret; =20 - mipi_dsi_detach(dsi); + ret =3D mipi_dsi_detach(dsi); + if (ret < 0) + dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); + /* Power off */ ret =3D nt35510_power_off(nt); if (ret) dev_err(&dsi->dev, "Failed to power off\n"); - - drm_panel_remove(&nt->panel); } =20 /* diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35532.c b/drivers/gpu/dr= m/panel/panel-novatek-nt35532.c index edea766a3c44..752144220514 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35532.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35532.c @@ -752,29 +752,17 @@ static int nt35532_probe(struct mipi_dsi_device *dsi) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - } =20 return 0; } =20 -static void nt35532_remove(struct mipi_dsi_device *dsi) -{ - struct novatek_nt35532 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id nt35532_of_match[] =3D { { .compatible =3D "flipkart,rimob-panel-nt35532-cs", .data =3D &rimob_pan= el_desc }, { /* sentinel */ } @@ -783,7 +771,6 @@ MODULE_DEVICE_TABLE(of, nt35532_of_match); =20 static struct mipi_dsi_driver nt35532_driver =3D { .probe =3D nt35532_probe, - .remove =3D nt35532_remove, .driver =3D { .name =3D "panel-novatek-nt35532", .of_match_table =3D nt35532_of_match, diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35560.c b/drivers/gpu/dr= m/panel/panel-novatek-nt35560.c index 6e5173f98a22..be42eb9ef423 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35560.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35560.c @@ -433,23 +433,11 @@ static int nt35560_probe(struct mipi_dsi_device *dsi) return dev_err_probe(dev, PTR_ERR(nt->panel.backlight), "failed to register backlight device\n"); =20 - drm_panel_add(&nt->panel); - - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&nt->panel); + ret =3D devm_drm_panel_add(dev, &nt->panel); + if (ret) return ret; - } - - return 0; -} - -static void nt35560_remove(struct mipi_dsi_device *dsi) -{ - struct nt35560 *nt =3D mipi_dsi_get_drvdata(dsi); =20 - mipi_dsi_detach(dsi); - drm_panel_remove(&nt->panel); + return devm_mipi_dsi_attach(dev, dsi); } =20 static const struct of_device_id nt35560_of_match[] =3D { @@ -467,7 +455,6 @@ MODULE_DEVICE_TABLE(of, nt35560_of_match); =20 static struct mipi_dsi_driver nt35560_driver =3D { .probe =3D nt35560_probe, - .remove =3D nt35560_remove, .driver =3D { .name =3D "panel-novatek-nt35560", .of_match_table =3D nt35560_of_match, diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/d= rm/panel/panel-novatek-nt36672a.c index 464d9ce47d87..da466cdd9354 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c @@ -428,9 +428,7 @@ static int nt36672a_panel_add(struct nt36672a_panel *pi= nfo) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); =20 - drm_panel_add(&pinfo->base); - - return 0; + return devm_drm_panel_add(dev, &pinfo->base); } =20 static int nt36672a_panel_probe(struct mipi_dsi_device *dsi) @@ -458,25 +456,7 @@ static int nt36672a_panel_probe(struct mipi_dsi_device= *dsi) if (err < 0) return err; =20 - err =3D mipi_dsi_attach(dsi); - if (err < 0) { - drm_panel_remove(&pinfo->base); - return err; - } - - return 0; -} - -static void nt36672a_panel_remove(struct mipi_dsi_device *dsi) -{ - struct nt36672a_panel *pinfo =3D mipi_dsi_get_drvdata(dsi); - int err; - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); - - drm_panel_remove(&pinfo->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static const struct of_device_id tianma_fhd_video_of_match[] =3D { @@ -491,7 +471,6 @@ static struct mipi_dsi_driver nt36672a_panel_driver =3D= { .of_match_table =3D tianma_fhd_video_of_match, }, .probe =3D nt36672a_panel_probe, - .remove =3D nt36672a_panel_remove, }; module_mipi_dsi_driver(nt36672a_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c b/drivers/gpu/d= rm/panel/panel-novatek-nt36672e.c index c5e00eb55722..85902338f10d 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672e.c @@ -561,27 +561,17 @@ static int nt36672e_panel_probe(struct mipi_dsi_devic= e *dsi) =20 ctx->panel.prepare_prev_first =3D true; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { dev_err(dev, "Failed to attach to DSI host: %d\n", ret); - goto err_dsi_attach; + return ret; } =20 return 0; - -err_dsi_attach: - drm_panel_remove(&ctx->panel); - return ret; -} - -static void nt36672e_panel_remove(struct mipi_dsi_device *dsi) -{ - struct nt36672e_panel *ctx =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(ctx->dsi); - drm_panel_remove(&ctx->panel); } =20 static const struct of_device_id nt36672e_of_match[] =3D { @@ -599,7 +589,6 @@ static struct mipi_dsi_driver nt36672e_panel_driver =3D= { .of_match_table =3D nt36672e_of_match, }, .probe =3D nt36672e_panel_probe, - .remove =3D nt36672e_panel_remove, }; module_mipi_dsi_driver(nt36672e_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c b/drivers/gpu/d= rm/panel/panel-novatek-nt37700f.c index c221dd498fed..c2d219e52f6a 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt37700f.c @@ -257,29 +257,17 @@ static int nt37700f_tianma_probe(struct mipi_dsi_devi= ce *dsi) return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), "Failed to create backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - } =20 return 0; } =20 -static void nt37700f_tianma_remove(struct mipi_dsi_device *dsi) -{ - struct nt37700f_tianma *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id nt37700f_tianma_of_match[] =3D { { .compatible =3D "novatek,nt37700f" }, { /* sentinel */ } @@ -288,7 +276,6 @@ MODULE_DEVICE_TABLE(of, nt37700f_tianma_of_match); =20 static struct mipi_dsi_driver nt37700f_tianma_driver =3D { .probe =3D nt37700f_tianma_probe, - .remove =3D nt37700f_tianma_remove, .driver =3D { .name =3D "panel-novatek-nt37700f", .of_match_table =3D nt37700f_tianma_of_match, diff --git a/drivers/gpu/drm/panel/panel-novatek-nt37801.c b/drivers/gpu/dr= m/panel/panel-novatek-nt37801.c index 5e46c4c6d771..4db560b66f4d 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt37801.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt37801.c @@ -270,7 +270,9 @@ static int novatek_nt37801_probe(struct mipi_dsi_device= *dsi) return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), "Failed to create backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 /* This panel only supports DSC; unconditionally enable it */ dsi->dsc =3D &ctx->dsc; @@ -283,27 +285,13 @@ static int novatek_nt37801_probe(struct mipi_dsi_devi= ce *dsi) ctx->dsc.bits_per_pixel =3D 8 << 4; /* 4 fractional bits */ ctx->dsc.block_pred_enable =3D true; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - } =20 return 0; } =20 -static void novatek_nt37801_remove(struct mipi_dsi_device *dsi) -{ - struct novatek_nt37801 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id novatek_nt37801_of_match[] =3D { { .compatible =3D "novatek,nt37801" }, {} @@ -312,7 +300,6 @@ MODULE_DEVICE_TABLE(of, novatek_nt37801_of_match); =20 static struct mipi_dsi_driver novatek_nt37801_driver =3D { .probe =3D novatek_nt37801_probe, - .remove =3D novatek_nt37801_remove, .driver =3D { .name =3D "panel-novatek-nt37801", .of_match_table =3D novatek_nt37801_of_match, diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67191.c b/drivers/gpu/dr= m/panel/panel-raydium-rm67191.c index 2af6aa47a551..62062ae0ebe3 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm67191.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c @@ -590,26 +590,11 @@ static int rad_panel_probe(struct mipi_dsi_device *ds= i) =20 dev_set_drvdata(dev, panel); =20 - drm_panel_add(&panel->panel); - - ret =3D mipi_dsi_attach(dsi); - if (ret) - drm_panel_remove(&panel->panel); - - return ret; -} - -static void rad_panel_remove(struct mipi_dsi_device *dsi) -{ - struct rad_panel *rad =3D mipi_dsi_get_drvdata(dsi); - struct device *dev =3D &dsi->dev; - int ret; - - ret =3D mipi_dsi_detach(dsi); + ret =3D devm_drm_panel_add(dev, &panel->panel); if (ret) - dev_err(dev, "Failed to detach from host (%d)\n", ret); + return ret; =20 - drm_panel_remove(&rad->panel); + return devm_mipi_dsi_attach(dev, dsi); } =20 static const struct of_device_id rad_of_match[] =3D { @@ -624,7 +609,6 @@ static struct mipi_dsi_driver rad_panel_driver =3D { .of_match_table =3D rad_of_match, }, .probe =3D rad_panel_probe, - .remove =3D rad_panel_remove, }; module_mipi_dsi_driver(rad_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67200.c b/drivers/gpu/dr= m/panel/panel-raydium-rm67200.c index b2ba006c06f6..e16f9ad6d193 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm67200.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm67200.c @@ -420,29 +420,17 @@ static int raydium_rm67200_probe(struct mipi_dsi_devi= ce *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { + ret =3D devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) dev_err(dev, "Failed to attach to DSI host: %d\n", ret); - drm_panel_remove(&ctx->panel); - } =20 return ret; } =20 -static void raydium_rm67200_remove(struct mipi_dsi_device *dsi) -{ - struct raydium_rm67200 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct regulator_bulk_data w552793baa_regulators[] =3D { { .supply =3D "vdd", }, /* 2.8V */ { .supply =3D "iovcc", }, /* 1.8V */ @@ -479,7 +467,6 @@ MODULE_DEVICE_TABLE(of, raydium_rm67200_of_match); =20 static struct mipi_dsi_driver raydium_rm67200_driver =3D { .probe =3D raydium_rm67200_probe, - .remove =3D raydium_rm67200_remove, .driver =3D { .name =3D "panel-raydium-rm67200", .of_match_table =3D raydium_rm67200_of_match, diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/dr= m/panel/panel-raydium-rm68200.c index c535dc931903..f235cb4ae071 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c @@ -360,26 +360,19 @@ static int rm68200_probe(struct mipi_dsi_device *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { dev_err(dev, "mipi_dsi_attach() failed: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 return 0; } =20 -static void rm68200_remove(struct mipi_dsi_device *dsi) -{ - struct rm68200 *ctx =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id raydium_rm68200_of_match[] =3D { { .compatible =3D "raydium,rm68200" }, { } @@ -388,7 +381,6 @@ MODULE_DEVICE_TABLE(of, raydium_rm68200_of_match); =20 static struct mipi_dsi_driver raydium_rm68200_driver =3D { .probe =3D rm68200_probe, - .remove =3D rm68200_remove, .driver =3D { .name =3D "panel-raydium-rm68200", .of_match_table =3D raydium_rm68200_of_match, diff --git a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c b/drivers/gpu/dr= m/panel/panel-raydium-rm692e5.c index 8e9484768657..4065cdf690f9 100644 --- a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c +++ b/drivers/gpu/drm/panel/panel-raydium-rm692e5.c @@ -315,7 +315,9 @@ static int rm692e5_probe(struct mipi_dsi_device *dsi) return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), "Failed to create backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 /* This panel only supports DSC; unconditionally enable it */ dsi->dsc =3D &ctx->dsc; @@ -331,28 +333,15 @@ static int rm692e5_probe(struct mipi_dsi_device *dsi) ctx->dsc.bits_per_pixel =3D 8 << 4; /* 4 fractional bits */ ctx->dsc.block_pred_enable =3D true; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { dev_err(dev, "Failed to attach to DSI host: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 return 0; } =20 -static void rm692e5_remove(struct mipi_dsi_device *dsi) -{ - struct rm692e5_panel *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id rm692e5_of_match[] =3D { { .compatible =3D "fairphone,fp5-rm692e5-boe" }, { } @@ -361,7 +350,6 @@ MODULE_DEVICE_TABLE(of, rm692e5_of_match); =20 static struct mipi_dsi_driver rm692e5_driver =3D { .probe =3D rm692e5_probe, - .remove =3D rm692e5_remove, .driver =3D { .name =3D "panel-rm692e5-boe-amoled", .of_match_table =3D rm692e5_of_match, --=20 2.43.0 From nobody Thu Sep 24 18:37:40 2026 Received: from mail-wm2-f12.google.com (mail-wm2-f12.google.com [74.125.225.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 256BF48F82F for ; Mon, 21 Sep 2026 13:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789996787; cv=none; b=RabFqXdsaF1MRNbKJuWctYlEigx80doThM0HTbxz1qVNoPRNz0osetKicOKvAD8QoNP6iA0zb9RPMBbwUJ+l3vGVOs10543KQwLtuAT32G/ytzPEFpJGk0bo9YPTwRBrIHp8jNmJB+cwqvPgg+u7J7dv7PW0qPSBb95Rvx0JOiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789996787; c=relaxed/simple; bh=MXvn4wZJp4UdwboyHkHxQR3xosJDX/c23bKqjfe7bJU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iI/82PveKzZgJGgD8Xp18jyx/GYK65atXr7NUsQZbunIJdiAR/nH7wadkrdnakrM9DX6RmkfqTY3ym5T85ARCHh47AaanYy93Kh/xT38LyiuzX+p8hBn2PB+d3RmSpnjcyMyAzguBdYz26mT6QFroQwZJD2bMnTOSs5Gn0YtN88= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fbZif2xi; arc=none smtp.client-ip=74.125.225.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fbZif2xi" Received: by mail-wm2-f12.google.com with SMTP id 5b1f17b1804b1-49ccff31419so25131535e9.3 for ; Mon, 21 Sep 2026 06:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789996781; x=1790601581; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=5pNFToUTOKhV4/wIyJgAcpV4Bp8sWWF/8isf8dRjc8A=; b=fbZif2xiCRJS6tCJZHb3Gj/C1G6vMZ5Sdk5w5uw5Vji9LqhkkHzbTaR/Yp+1nGRmqL Mqwa3A1dBk1yM8kkFA/1uLft4salgz491mLGXSr5scCkRGwPInINZF9P97YUQliIO3sb IXLAtIVu100HELrWthlnhv7kwNjibZ/T9IWUOsh9sWkyEJjSq2QwG05sQbob8jbdTLj9 6l/2jI3uZF8X8o2/jBs7Ka9ZiiWRrkXM59EPOxVnjT5AkzflMRH0xJP+b9Y2OrjyyuCz jy3nNzWDSAtVn1j4ZT3yzzoU/04a/suV2fZBEJTg2LNqXUl9vQX2+XBc2/kB+0FjUfMy CPrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789996781; x=1790601581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=5pNFToUTOKhV4/wIyJgAcpV4Bp8sWWF/8isf8dRjc8A=; b=ZZCLEcB7hfIRvJMpVbJvfcyN6jj1974YsH6w2Gdg8GlS8roqjwqnTbT9QtLPIrlhz3 fhrSal80g/iQilYunhmJzFRcyCWq/afOJVU9XiQJD9RM66lNbG6V0ThpsWR+aNzBMaEw aWl7kxT10gkYjLkl6It25dT4xf2jgHh9ExDwiPo6qZtRxqFZG3n3RTEw0CmJbqjGLVo9 GJCHr/HVRzn28hph9A87qLIYyQe+wnViUGTbigbHLUfd4EsZsNWcmpDNI9v7zRcZN3eF qASq6r6wL2f5syowjroNQUqKoS4MUVfTF8F3Sv10ChBgOxw/wmDix3Jw+4IFzuqRpvGt OXZw== X-Forwarded-Encrypted: i=1; AKwUvBwGYFEkJG7FBJHZi0J4oc6xlhuAGtvwSosCpByyNXvk43QuL1GDCMyp/6kiRpIPx91Q4C/iuY6E3NTcwIw=@vger.kernel.org X-Gm-Message-State: AFuF++mOHspACCgenpAFH1aahgkpKEdxHmP5ox2U2moONbOpc2CmwH3q n/5V4YmgdZsS10ufSZQBtaVg2lQOhLgdsgGfmuHPg3JtTM1aVfhl9zY+ X-Gm-Gg: AYBFou2ZOXUiwMFLkswiADGc17nW45YxrotLdp2wa5qzx3b+Y7uaKgET5cPihkam8gB 4A8D+9FvfsBeeeaIKSYb1hziFlXVf3MkZARxVvR6mQUpFivNOaimbv3Z0BMvnNGTJQqB/E4ZcER baqxZM/1Wun+ZZm5tPTthY6I8c4pYxSEHALaFwMtV5By3Now9BdrzzyLTGVnMjxWCHMoU0kQqf5 K3b5Ls35ltBIQnLzmVlsGsdVKEIx1OouSlfoOKjp3gv+yhzbxq0T07uoKxT86bUXBWLSkREYqJ5 JZhoGm+i8bkR5P+cMNEXnKsUtxKTu+jSaOVCpWHw04acX8x6yBXRyAf8pw431mi/+RGxQUnutZB GfgwmJEeF6HM7cGFhO/jaZY66Et41xUHoFBgkSF9bZTaEUw+3Zicv6D/J4qxHPvbGTGsRzBmfnx BhZklBZmkLm5aHjnoeVs3yVs4uEeCxQmjfHLTjTNF8i9kxqdTvGgncyCe9+QMcvr24m923g0qYd OyZPSMDdlgfd0mozbDIojrcMoJb88h7pQ== X-Received: by 2002:a05:600c:154b:b0:49c:fa21:1c89 with SMTP id 5b1f17b1804b1-49fc5748e61mr162185945e9.30.1789996780850; Mon, 21 Sep 2026 06:19:40 -0700 (PDT) Received: from osama.. ([156.223.80.28]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48724460978sm22198797f8f.11.2026.09.21.06.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 06:19:40 -0700 (PDT) From: Osama Abdelkader To: Luca Ceresoli , Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Joel Selvaraj , Icenowy Zheng , Jagan Teki , Sumit Semwal , Casey Connolly , Michael Tretter , =?UTF-8?q?Guido=20G=C3=BCnther?= , Sasha Finkelstein , Michael Trimarchi Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jessica Zhang , Osama Abdelkader , Purism Kernel Team , Ondrej Jirman , Janne Grunau , asahi@lists.linux.dev Subject: [PATCH v7 3/3] drm/panel: Use managed helpers in assorted panels Date: Mon, 21 Sep 2026 15:17:57 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the managed MIPI DSI attach and panel add helpers in assorted panel drivers and drop the corresponding manual detach and panel remove calls from remove paths. Suggested-by: Luca Ceresoli Signed-off-by: Osama Abdelkader --- v7: - Changelog is trimmed. No code changes from v6. v6: - Drop panel-simple and panel-dsi-cm: both run extra teardown after drm_panel_remove(), which devm would reorder. - khadas-ts050, tdo-tl070wsh30: fix build break. .../drm/panel/panel-asus-z00t-tm5p5-n35596.c | 20 +++-------- .../gpu/drm/panel/panel-chipwealth-ch13726a.c | 20 +++-------- drivers/gpu/drm/panel/panel-ebbg-ft8719.c | 20 +++-------- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 20 +++-------- .../gpu/drm/panel/panel-feixin-k101-im2ba02.c | 19 +++-------- .../drm/panel/panel-feiyang-fy07024di26a30d.c | 19 +++-------- drivers/gpu/drm/panel/panel-hydis-hv101hd1.c | 24 +++----------- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 33 +++---------------- .../gpu/drm/panel/panel-jadard-jd9365da-h3.c | 19 +++-------- drivers/gpu/drm/panel/panel-khadas-ts050.c | 23 +++---------- .../drm/panel/panel-kingdisplay-kd097d04.c | 30 ++--------------- drivers/gpu/drm/panel/panel-lg-sw43408.c | 22 ++++--------- .../gpu/drm/panel/panel-lincolntech-lcd197.c | 20 ++--------- drivers/gpu/drm/panel/panel-lxd-m9189a.c | 24 +++----------- .../gpu/drm/panel/panel-mantix-mlaf057we51.c | 16 +++------ .../gpu/drm/panel/panel-newvision-nv3051d.c | 22 +++---------- .../gpu/drm/panel/panel-orisetech-otm8009a.c | 16 +++------ .../drm/panel/panel-osd-osd101t2587-53ts.c | 23 +++---------- .../drm/panel/panel-panasonic-vvx10f034n00.c | 31 ++--------------- drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 19 +++-------- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 13 +++----- drivers/gpu/drm/panel/panel-sitronix-st7703.c | 14 +++----- .../drm/panel/panel-startek-kd070fhfid015.c | 24 +++----------- drivers/gpu/drm/panel/panel-summit.c | 15 +++------ .../gpu/drm/panel/panel-synaptics-r63353.c | 25 ++------------ drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 19 +++-------- .../gpu/drm/panel/panel-xinpeng-xpp055c272.c | 20 +++-------- 27 files changed, 109 insertions(+), 461 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c b/drivers= /gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c index db006576d704..0f98ea096f5f 100644 --- a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c +++ b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c @@ -262,9 +262,11 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device = *dsi) return ret; } =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "Failed to attach to DSI host: %d\n", ret); return ret; @@ -273,19 +275,6 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device = *dsi) return 0; } =20 -static void tm5p5_nt35596_remove(struct mipi_dsi_device *dsi) -{ - struct tm5p5_nt35596 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, - "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id tm5p5_nt35596_of_match[] =3D { { .compatible =3D "asus,z00t-tm5p5-n35596" }, { /* sentinel */ } @@ -294,7 +283,6 @@ MODULE_DEVICE_TABLE(of, tm5p5_nt35596_of_match); =20 static struct mipi_dsi_driver tm5p5_nt35596_driver =3D { .probe =3D tm5p5_nt35596_probe, - .remove =3D tm5p5_nt35596_remove, .driver =3D { .name =3D "panel-tm5p5-nt35596", .of_match_table =3D tm5p5_nt35596_of_match, diff --git a/drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c b/drivers/gp= u/drm/panel/panel-chipwealth-ch13726a.c index 562dc573528d..e72636919d5a 100644 --- a/drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c +++ b/drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c @@ -290,30 +290,19 @@ static int ch13726a_probe(struct mipi_dsi_device *dsi) return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), "Failed to create backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "Failed to attach to DSI host: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 return 0; } =20 -static void ch13726a_remove(struct mipi_dsi_device *dsi) -{ - struct ch13726a_panel *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id ch13726a_of_match[] =3D { { .compatible =3D "ayntec,thor-panel-bottom", .data =3D &thor_bottom_desc= }, { /* sentinel */ } @@ -322,7 +311,6 @@ MODULE_DEVICE_TABLE(of, ch13726a_of_match); =20 static struct mipi_dsi_driver ch13726a_driver =3D { .probe =3D ch13726a_probe, - .remove =3D ch13726a_remove, .driver =3D { .name =3D "panel-ch13726a-amoled", .of_match_table =3D ch13726a_of_match, diff --git a/drivers/gpu/drm/panel/panel-ebbg-ft8719.c b/drivers/gpu/drm/pa= nel/panel-ebbg-ft8719.c index fb9f9f42be4f..508ea77f007b 100644 --- a/drivers/gpu/drm/panel/panel-ebbg-ft8719.c +++ b/drivers/gpu/drm/panel/panel-ebbg-ft8719.c @@ -202,30 +202,19 @@ static int ebbg_ft8719_probe(struct mipi_dsi_device *= dsi) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "Failed to attach to DSI host: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 return 0; } =20 -static void ebbg_ft8719_remove(struct mipi_dsi_device *dsi) -{ - struct ebbg_ft8719 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id ebbg_ft8719_of_match[] =3D { { .compatible =3D "ebbg,ft8719" }, { /* sentinel */ } @@ -234,7 +223,6 @@ MODULE_DEVICE_TABLE(of, ebbg_ft8719_of_match); =20 static struct mipi_dsi_driver ebbg_ft8719_driver =3D { .probe =3D ebbg_ft8719_probe, - .remove =3D ebbg_ft8719_remove, .driver =3D { .name =3D "panel-ebbg-ft8719", .of_match_table =3D ebbg_ft8719_of_match, diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm= /panel/panel-elida-kd35t133.c index d23002b5a2d7..cc09ef9ac91c 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -254,30 +254,19 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "mipi_dsi_attach failed: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 return 0; } =20 -static void kd35t133_remove(struct mipi_dsi_device *dsi) -{ - struct kd35t133 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id kd35t133_of_match[] =3D { { .compatible =3D "elida,kd35t133" }, { /* sentinel */ } @@ -290,7 +279,6 @@ static struct mipi_dsi_driver kd35t133_driver =3D { .of_match_table =3D kd35t133_of_match, }, .probe =3D kd35t133_probe, - .remove =3D kd35t133_remove, }; module_mipi_dsi_driver(kd35t133_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c b/drivers/gp= u/drm/panel/panel-feixin-k101-im2ba02.c index 8c3a231c147d..c58d8fe0c384 100644 --- a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c +++ b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c @@ -468,29 +468,21 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_dev= ice *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(&dsi->dev, &ctx->panel); + if (ret) + return ret; =20 dsi->mode_flags =3D MIPI_DSI_MODE_VIDEO; dsi->format =3D MIPI_DSI_FMT_RGB888; dsi->lanes =3D 4; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); + if (ret < 0) return ret; - } =20 return 0; } =20 -static void k101_im2ba02_dsi_remove(struct mipi_dsi_device *dsi) -{ - struct k101_im2ba02 *ctx =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id k101_im2ba02_of_match[] =3D { { .compatible =3D "feixin,k101-im2ba02", }, { /* sentinel */ } @@ -499,7 +491,6 @@ MODULE_DEVICE_TABLE(of, k101_im2ba02_of_match); =20 static struct mipi_dsi_driver k101_im2ba02_driver =3D { .probe =3D k101_im2ba02_dsi_probe, - .remove =3D k101_im2ba02_dsi_remove, .driver =3D { .name =3D "feixin-k101-im2ba02", .of_match_table =3D k101_im2ba02_of_match, diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/driver= s/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c index c1d8ca5ca6e1..2116b3f50402 100644 --- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c @@ -213,29 +213,21 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *= dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(&dsi->dev, &ctx->panel); + if (ret) + return ret; =20 dsi->mode_flags =3D MIPI_DSI_MODE_VIDEO_BURST; dsi->format =3D MIPI_DSI_FMT_RGB888; dsi->lanes =3D 4; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); + if (ret < 0) return ret; - } =20 return 0; } =20 -static void feiyang_dsi_remove(struct mipi_dsi_device *dsi) -{ - struct feiyang *ctx =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id feiyang_of_match[] =3D { { .compatible =3D "feiyang,fy07024di26a30d", }, { /* sentinel */ } @@ -244,7 +236,6 @@ MODULE_DEVICE_TABLE(of, feiyang_of_match); =20 static struct mipi_dsi_driver feiyang_driver =3D { .probe =3D feiyang_dsi_probe, - .remove =3D feiyang_dsi_remove, .driver =3D { .name =3D "feiyang-fy07024di26a30d", .of_match_table =3D feiyang_of_match, diff --git a/drivers/gpu/drm/panel/panel-hydis-hv101hd1.c b/drivers/gpu/drm= /panel/panel-hydis-hv101hd1.c index 0a96eb0fae1e..4cddc6052514 100644 --- a/drivers/gpu/drm/panel/panel-hydis-hv101hd1.c +++ b/drivers/gpu/drm/panel/panel-hydis-hv101hd1.c @@ -142,30 +142,17 @@ static int hv101hd1_probe(struct mipi_dsi_device *dsi) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); =20 - drm_panel_add(&hv->panel); + ret =3D devm_drm_panel_add(dev, &hv->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret) { - drm_panel_remove(&hv->panel); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); + if (ret) return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - } =20 return 0; } =20 -static void hv101hd1_remove(struct mipi_dsi_device *dsi) -{ - struct hv101hd1 *hv =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, - "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&hv->panel); -} - static const struct of_device_id hv101hd1_of_match[] =3D { { .compatible =3D "hydis,hv101hd1" }, { /* sentinel */ } @@ -178,7 +165,6 @@ static struct mipi_dsi_driver hv101hd1_driver =3D { .of_match_table =3D hv101hd1_of_match, }, .probe =3D hv101hd1_probe, - .remove =3D hv101hd1_remove, }; module_mipi_dsi_driver(hv101hd1_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/dr= m/panel/panel-innolux-p079zca.c index 80afeeab9475..a9576511dd7f 100644 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c @@ -416,7 +416,9 @@ static int innolux_panel_add(struct mipi_dsi_device *ds= i, if (err) return err; =20 - drm_panel_add(&innolux->base); + err =3D devm_drm_panel_add(dev, &innolux->base); + if (err) + return err; =20 mipi_dsi_set_drvdata(dsi, innolux); innolux->link =3D dsi; @@ -424,15 +426,9 @@ static int innolux_panel_add(struct mipi_dsi_device *d= si, return 0; } =20 -static void innolux_panel_del(struct innolux_panel *innolux) -{ - drm_panel_remove(&innolux->base); -} - static int innolux_panel_probe(struct mipi_dsi_device *dsi) { const struct panel_desc *desc; - struct innolux_panel *innolux; int err; =20 desc =3D of_device_get_match_data(&dsi->dev); @@ -444,27 +440,7 @@ static int innolux_panel_probe(struct mipi_dsi_device = *dsi) if (err < 0) return err; =20 - err =3D mipi_dsi_attach(dsi); - if (err < 0) { - innolux =3D mipi_dsi_get_drvdata(dsi); - innolux_panel_del(innolux); - return err; - } - - return 0; -} - -static void innolux_panel_remove(struct mipi_dsi_device *dsi) -{ - struct innolux_panel *innolux =3D mipi_dsi_get_drvdata(dsi); - int err; - - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); - - innolux_panel_del(innolux); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver innolux_panel_driver =3D { @@ -473,7 +449,6 @@ static struct mipi_dsi_driver innolux_panel_driver =3D { .of_match_table =3D innolux_of_match, }, .probe =3D innolux_panel_probe, - .remove =3D innolux_panel_remove, }; module_mipi_dsi_driver(innolux_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu= /drm/panel/panel-jadard-jd9365da-h3.c index 5202c1ffc6e1..b6fadab7cfec 100644 --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c @@ -3245,25 +3245,15 @@ static int jadard_dsi_probe(struct mipi_dsi_device = *dsi) =20 jadard->panel.prepare_prev_first =3D true; =20 - drm_panel_add(&jadard->panel); + ret =3D devm_drm_panel_add(dev, &jadard->panel); + if (ret) + return ret; =20 mipi_dsi_set_drvdata(dsi, jadard); jadard->dsi =3D dsi; jadard->desc =3D desc; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) - drm_panel_remove(&jadard->panel); - - return ret; -} - -static void jadard_dsi_remove(struct mipi_dsi_device *dsi) -{ - struct jadard *jadard =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&jadard->panel); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static const struct of_device_id jadard_of_match[] =3D { @@ -3333,7 +3323,6 @@ MODULE_DEVICE_TABLE(of, jadard_of_match); =20 static struct mipi_dsi_driver jadard_driver =3D { .probe =3D jadard_dsi_probe, - .remove =3D jadard_dsi_remove, .driver =3D { .name =3D "jadard-jd9365da", .of_match_table =3D jadard_of_match, diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/p= anel/panel-khadas-ts050.c index 67ca055f06f3..b3c56ed4589e 100644 --- a/drivers/gpu/drm/panel/panel-khadas-ts050.c +++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c @@ -825,7 +825,9 @@ static int khadas_ts050_panel_add(struct khadas_ts050_p= anel *khadas_ts050) if (err) return err; =20 - drm_panel_add(&khadas_ts050->base); + err =3D devm_drm_panel_add(dev, &khadas_ts050->base); + if (err) + return err; =20 return 0; } @@ -862,23 +864,7 @@ static int khadas_ts050_panel_probe(struct mipi_dsi_de= vice *dsi) if (err < 0) return err; =20 - err =3D mipi_dsi_attach(dsi); - if (err) - drm_panel_remove(&khadas_ts050->base); - - return err; -} - -static void khadas_ts050_panel_remove(struct mipi_dsi_device *dsi) -{ - struct khadas_ts050_panel *khadas_ts050 =3D mipi_dsi_get_drvdata(dsi); - int err; - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); - - drm_panel_remove(&khadas_ts050->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver khadas_ts050_panel_driver =3D { @@ -887,7 +873,6 @@ static struct mipi_dsi_driver khadas_ts050_panel_driver= =3D { .of_match_table =3D khadas_ts050_of_match, }, .probe =3D khadas_ts050_panel_probe, - .remove =3D khadas_ts050_panel_remove, }; module_mipi_dsi_driver(khadas_ts050_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/g= pu/drm/panel/panel-kingdisplay-kd097d04.c index 893af9b16756..bcdc95538f0c 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -341,14 +341,7 @@ static int kingdisplay_panel_add(struct kingdisplay_pa= nel *kingdisplay) if (err) return err; =20 - drm_panel_add(&kingdisplay->base); - - return 0; -} - -static void kingdisplay_panel_del(struct kingdisplay_panel *kingdisplay) -{ - drm_panel_remove(&kingdisplay->base); + return devm_drm_panel_add(dev, &kingdisplay->base); } =20 static int kingdisplay_panel_probe(struct mipi_dsi_device *dsi) @@ -375,25 +368,7 @@ static int kingdisplay_panel_probe(struct mipi_dsi_dev= ice *dsi) if (err < 0) return err; =20 - err =3D mipi_dsi_attach(dsi); - if (err < 0) { - kingdisplay_panel_del(kingdisplay); - return err; - } - - return 0; -} - -static void kingdisplay_panel_remove(struct mipi_dsi_device *dsi) -{ - struct kingdisplay_panel *kingdisplay =3D mipi_dsi_get_drvdata(dsi); - int err; - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); - - kingdisplay_panel_del(kingdisplay); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver kingdisplay_panel_driver =3D { @@ -402,7 +377,6 @@ static struct mipi_dsi_driver kingdisplay_panel_driver = =3D { .of_match_table =3D kingdisplay_of_match, }, .probe =3D kingdisplay_panel_probe, - .remove =3D kingdisplay_panel_remove, }; module_mipi_dsi_driver(kingdisplay_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/pan= el/panel-lg-sw43408.c index 293826c5006b..822318f546ef 100644 --- a/drivers/gpu/drm/panel/panel-lg-sw43408.c +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -254,8 +254,11 @@ static int sw43408_add(struct sw43408_panel *ctx) =20 ctx->base.prepare_prev_first =3D true; =20 - drm_panel_add(&ctx->base); - return ret; + ret =3D devm_drm_panel_add(dev, &ctx->base); + if (ret) + return ret; + + return 0; } =20 static int sw43408_probe(struct mipi_dsi_device *dsi) @@ -294,19 +297,7 @@ static int sw43408_probe(struct mipi_dsi_device *dsi) =20 dsi->dsc =3D &ctx->dsc; =20 - return mipi_dsi_attach(dsi); -} - -static void sw43408_remove(struct mipi_dsi_device *dsi) -{ - struct sw43408_panel *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver sw43408_driver =3D { @@ -315,7 +306,6 @@ static struct mipi_dsi_driver sw43408_driver =3D { .of_match_table =3D sw43408_of_match, }, .probe =3D sw43408_probe, - .remove =3D sw43408_remove, }; module_mipi_dsi_driver(sw43408_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-lincolntech-lcd197.c b/drivers/gpu= /drm/panel/panel-lincolntech-lcd197.c index 24b34443ace0..677e86fe9d9d 100644 --- a/drivers/gpu/drm/panel/panel-lincolntech-lcd197.c +++ b/drivers/gpu/drm/panel/panel-lincolntech-lcd197.c @@ -220,24 +220,11 @@ static int lincoln_lcd197_panel_probe(struct mipi_dsi= _device *dsi) if (err) return err; =20 - drm_panel_add(&lcd->panel); - err =3D mipi_dsi_attach(dsi); + err =3D devm_drm_panel_add(dev, &lcd->panel); if (err) - drm_panel_remove(&lcd->panel); - - return err; -} - -static void lincoln_lcd197_panel_remove(struct mipi_dsi_device *dsi) -{ - struct lincoln_lcd197_panel *lcd =3D mipi_dsi_get_drvdata(dsi); - int err; - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); + return err; =20 - drm_panel_remove(&lcd->panel); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static const struct of_device_id lincoln_lcd197_of_match[] =3D { @@ -252,7 +239,6 @@ static struct mipi_dsi_driver lincoln_lcd197_panel_driv= er =3D { .of_match_table =3D lincoln_lcd197_of_match, }, .probe =3D lincoln_lcd197_panel_probe, - .remove =3D lincoln_lcd197_panel_remove, }; module_mipi_dsi_driver(lincoln_lcd197_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-lxd-m9189a.c b/drivers/gpu/drm/pan= el/panel-lxd-m9189a.c index baaf170779e0..a6174f895c99 100644 --- a/drivers/gpu/drm/panel/panel-lxd-m9189a.c +++ b/drivers/gpu/drm/panel/panel-lxd-m9189a.c @@ -200,28 +200,15 @@ static int lxd_m9189_probe(struct mipi_dsi_device *ds= i) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); =20 - drm_panel_add(&m9189->panel); - - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - drm_panel_remove(&m9189->panel); + ret =3D devm_drm_panel_add(dev, &m9189->panel); + if (ret) return ret; - } =20 - return 0; -} - -static void lxd_m9189_remove(struct mipi_dsi_device *dsi) -{ - struct m9189_panel *m9189 =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); + return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); =20 - drm_panel_remove(&m9189->panel); + return 0; } =20 static const struct of_device_id lxd_m9189_of_match[] =3D { @@ -232,7 +219,6 @@ MODULE_DEVICE_TABLE(of, lxd_m9189_of_match); =20 static struct mipi_dsi_driver lxd_m9189_driver =3D { .probe =3D lxd_m9189_probe, - .remove =3D lxd_m9189_remove, .driver =3D { .name =3D "panel-lxd-m9189a", .of_match_table =3D lxd_m9189_of_match, diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu= /drm/panel/panel-mantix-mlaf057we51.c index 27e188bb2d7f..dd768eeaba73 100644 --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c @@ -278,12 +278,13 @@ static int mantix_probe(struct mipi_dsi_device *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "mipi_dsi_attach failed (%d). Is host ready?\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 @@ -295,14 +296,6 @@ static int mantix_probe(struct mipi_dsi_device *dsi) return 0; } =20 -static void mantix_remove(struct mipi_dsi_device *dsi) -{ - struct mantix *ctx =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id mantix_of_match[] =3D { { .compatible =3D "mantix,mlaf057we51-x", .data =3D &default_mode_mantix = }, { .compatible =3D "ys,ys57pss36bh5gq", .data =3D &default_mode_ys }, @@ -312,7 +305,6 @@ MODULE_DEVICE_TABLE(of, mantix_of_match); =20 static struct mipi_dsi_driver mantix_driver =3D { .probe =3D mantix_probe, - .remove =3D mantix_remove, .driver =3D { .name =3D DRV_NAME, .of_match_table =3D mantix_of_match, diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/= drm/panel/panel-newvision-nv3051d.c index 22560384e48e..fdc8d2273b87 100644 --- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c +++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c @@ -397,12 +397,13 @@ static int panel_nv3051d_probe(struct mipi_dsi_device= *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "mipi_dsi_attach failed: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 @@ -418,20 +419,6 @@ static void panel_nv3051d_shutdown(struct mipi_dsi_dev= ice *dsi) drm_panel_disable(&ctx->panel); } =20 -static void panel_nv3051d_remove(struct mipi_dsi_device *dsi) -{ - struct panel_nv3051d *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - panel_nv3051d_shutdown(dsi); - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct drm_display_mode nv3051d_rgxx3_modes[] =3D { { /* 120hz */ .hdisplay =3D 640, @@ -531,7 +518,6 @@ static struct mipi_dsi_driver newvision_nv3051d_driver = =3D { .of_match_table =3D newvision_nv3051d_of_match, }, .probe =3D panel_nv3051d_probe, - .remove =3D panel_nv3051d_remove, .shutdown =3D panel_nv3051d_shutdown, }; module_mipi_dsi_driver(newvision_nv3051d_driver); diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu= /drm/panel/panel-orisetech-otm8009a.c index 130520558a81..871259c4e873 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -432,26 +432,19 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi) ctx->bl_dev->props.power =3D BACKLIGHT_POWER_OFF; ctx->bl_dev->props.type =3D BACKLIGHT_RAW; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "mipi_dsi_attach failed. Is host ready?\n"); - drm_panel_remove(&ctx->panel); return ret; } =20 return 0; } =20 -static void otm8009a_remove(struct mipi_dsi_device *dsi) -{ - struct otm8009a *ctx =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id orisetech_otm8009a_of_match[] =3D { { .compatible =3D "orisetech,otm8009a" }, { } @@ -460,7 +453,6 @@ MODULE_DEVICE_TABLE(of, orisetech_otm8009a_of_match); =20 static struct mipi_dsi_driver orisetech_otm8009a_driver =3D { .probe =3D otm8009a_probe, - .remove =3D otm8009a_remove, .driver =3D { .name =3D "panel-orisetech-otm8009a", .of_match_table =3D orisetech_otm8009a_of_match, diff --git a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c b/drivers/g= pu/drm/panel/panel-osd-osd101t2587-53ts.c index 63ae9dc5712f..ae6b3ae5a120 100644 --- a/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +++ b/drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c @@ -134,7 +134,9 @@ static int osd101t2587_panel_add(struct osd101t2587_pan= el *osd101t2587) if (ret) return ret; =20 - drm_panel_add(&osd101t2587->base); + ret =3D devm_drm_panel_add(dev, &osd101t2587->base); + if (ret) + return ret; =20 return 0; } @@ -172,23 +174,7 @@ static int osd101t2587_panel_probe(struct mipi_dsi_dev= ice *dsi) if (ret < 0) return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret) - drm_panel_remove(&osd101t2587->base); - - return ret; -} - -static void osd101t2587_panel_remove(struct mipi_dsi_device *dsi) -{ - struct osd101t2587_panel *osd101t2587 =3D mipi_dsi_get_drvdata(dsi); - int ret; - - drm_panel_remove(&osd101t2587->base); - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver osd101t2587_panel_driver =3D { @@ -197,7 +183,6 @@ static struct mipi_dsi_driver osd101t2587_panel_driver = =3D { .of_match_table =3D osd101t2587_of_match, }, .probe =3D osd101t2587_panel_probe, - .remove =3D osd101t2587_panel_remove, }; module_mipi_dsi_driver(osd101t2587_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers= /gpu/drm/panel/panel-panasonic-vvx10f034n00.c index d21d93a0700e..c00b1c44611a 100644 --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c @@ -172,15 +172,7 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *w= uxga_nt) if (ret) return ret; =20 - drm_panel_add(&wuxga_nt->base); - - return 0; -} - -static void wuxga_nt_panel_del(struct wuxga_nt_panel *wuxga_nt) -{ - if (wuxga_nt->base.dev) - drm_panel_remove(&wuxga_nt->base); + return devm_drm_panel_add(dev, &wuxga_nt->base); } =20 static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi) @@ -210,25 +202,7 @@ static int wuxga_nt_panel_probe(struct mipi_dsi_device= *dsi) if (ret < 0) return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - wuxga_nt_panel_del(wuxga_nt); - return ret; - } - - return 0; -} - -static void wuxga_nt_panel_remove(struct mipi_dsi_device *dsi) -{ - struct wuxga_nt_panel *wuxga_nt =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); - - wuxga_nt_panel_del(wuxga_nt); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver wuxga_nt_panel_driver =3D { @@ -237,7 +211,6 @@ static struct mipi_dsi_driver wuxga_nt_panel_driver =3D= { .of_match_table =3D wuxga_nt_of_match, }, .probe =3D wuxga_nt_panel_probe, - .remove =3D wuxga_nt_panel_remove, }; module_mipi_dsi_driver(wuxga_nt_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c b/drivers/gpu/drm= /panel/panel-ronbo-rb070d30.c index c3fbc459c7e0..28236d4b60ec 100644 --- a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +++ b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c @@ -192,29 +192,21 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_d= evice *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(&dsi->dev, &ctx->panel); + if (ret) + return ret; =20 dsi->mode_flags =3D MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIP= I_DSI_MODE_LPM; dsi->format =3D MIPI_DSI_FMT_RGB888; dsi->lanes =3D 4; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); + if (ret < 0) return ret; - } =20 return 0; } =20 -static void rb070d30_panel_dsi_remove(struct mipi_dsi_device *dsi) -{ - struct rb070d30_panel *ctx =3D mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id rb070d30_panel_of_match[] =3D { { .compatible =3D "ronbo,rb070d30" }, { /* sentinel */ }, @@ -223,7 +215,6 @@ MODULE_DEVICE_TABLE(of, rb070d30_panel_of_match); =20 static struct mipi_dsi_driver rb070d30_panel_driver =3D { .probe =3D rb070d30_panel_dsi_probe, - .remove =3D rb070d30_panel_dsi_remove, .driver =3D { .name =3D "panel-ronbo-rb070d30", .of_match_table =3D rb070d30_panel_of_match, diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/dr= m/panel/panel-sitronix-st7701.c index f16e0de1ea60..31c56eadda12 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -1263,7 +1263,6 @@ static void st7701_cleanup(void *data) { struct st7701 *st7701 =3D (struct st7701 *)data; =20 - drm_panel_remove(&st7701->panel); drm_panel_disable(&st7701->panel); drm_panel_unprepare(&st7701->panel); } @@ -1318,7 +1317,9 @@ static int st7701_probe(struct device *dev, int conne= ctor_type) if (ret) return ret; =20 - drm_panel_add(&st7701->panel); + ret =3D devm_drm_panel_add(dev, &st7701->panel); + if (ret) + return ret; =20 dev_set_drvdata(dev, st7701); st7701->desc =3D desc; @@ -1347,7 +1348,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *d= si) dsi->format =3D st7701->desc->format; dsi->lanes =3D st7701->desc->lanes; =20 - err =3D mipi_dsi_attach(dsi); + err =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (err) return dev_err_probe(&dsi->dev, err, "Failed to init MIPI DSI\n"); =20 @@ -1379,11 +1380,6 @@ static int st7701_spi_probe(struct spi_device *spi) return 0; } =20 -static void st7701_dsi_remove(struct mipi_dsi_device *dsi) -{ - mipi_dsi_detach(dsi); -} - static const struct of_device_id st7701_dsi_of_match[] =3D { { .compatible =3D "anbernic,rg-arc-panel", .data =3D &rg_arc_desc }, { .compatible =3D "densitron,dmt028vghmcmi-1a", .data =3D &dmt028vghmcmi_= 1a_desc }, @@ -1408,7 +1404,6 @@ MODULE_DEVICE_TABLE(spi, st7701_spi_ids); =20 static struct mipi_dsi_driver st7701_dsi_driver =3D { .probe =3D st7701_dsi_probe, - .remove =3D st7701_dsi_remove, .driver =3D { .name =3D "st7701", .of_match_table =3D st7701_dsi_of_match, diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/dr= m/panel/panel-sitronix-st7703.c index 70f7282471e6..7ed1a51fff68 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -977,12 +977,13 @@ static int st7703_probe(struct mipi_dsi_device *dsi) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "mipi_dsi_attach failed (%d). Is host ready?\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 @@ -998,13 +999,6 @@ static int st7703_probe(struct mipi_dsi_device *dsi) static void st7703_remove(struct mipi_dsi_device *dsi) { struct st7703 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); =20 st7703_debugfs_remove(ctx); } diff --git a/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c b/drivers/= gpu/drm/panel/panel-startek-kd070fhfid015.c index 7f04b7b404e7..fe42bee14134 100644 --- a/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c +++ b/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c @@ -286,7 +286,9 @@ static int stk_panel_add(struct stk_panel *stk) return ret; } =20 - drm_panel_add(&stk->base); + ret =3D devm_drm_panel_add(dev, &stk->base); + if (ret) + return ret; =20 return 0; } @@ -315,24 +317,7 @@ static int stk_panel_probe(struct mipi_dsi_device *dsi) if (ret < 0) return ret; =20 - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) - drm_panel_remove(&stk->base); - - return 0; -} - -static void stk_panel_remove(struct mipi_dsi_device *dsi) -{ - struct stk_panel *stk =3D mipi_dsi_get_drvdata(dsi); - int err; - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", - err); - - drm_panel_remove(&stk->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver stk_panel_driver =3D { @@ -341,7 +326,6 @@ static struct mipi_dsi_driver stk_panel_driver =3D { .of_match_table =3D stk_of_match, }, .probe =3D stk_panel_probe, - .remove =3D stk_panel_remove, }; module_mipi_dsi_driver(stk_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-summit.c b/drivers/gpu/drm/panel/p= anel-summit.c index 84435be52424..8c5523d9793d 100644 --- a/drivers/gpu/drm/panel/panel-summit.c +++ b/drivers/gpu/drm/panel/panel-summit.c @@ -88,17 +88,11 @@ static int summit_probe(struct mipi_dsi_device *dsi) if (IS_ERR(s_data->bl)) return PTR_ERR(s_data->bl); =20 - drm_panel_add(&s_data->panel); - - return mipi_dsi_attach(dsi); -} - -static void summit_remove(struct mipi_dsi_device *dsi) -{ - struct summit_data *s_data =3D mipi_dsi_get_drvdata(dsi); + ret =3D devm_drm_panel_add(dev, &s_data->panel); + if (ret) + return ret; =20 - mipi_dsi_detach(dsi); - drm_panel_remove(&s_data->panel); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static int summit_suspend(struct device *dev) @@ -120,7 +114,6 @@ MODULE_DEVICE_TABLE(of, summit_of_match); =20 static struct mipi_dsi_driver summit_driver =3D { .probe =3D summit_probe, - .remove =3D summit_remove, .driver =3D { .name =3D "panel-summit", .of_match_table =3D summit_of_match, diff --git a/drivers/gpu/drm/panel/panel-synaptics-r63353.c b/drivers/gpu/d= rm/panel/panel-synaptics-r63353.c index 3a74d48753d9..73447d7b15d3 100644 --- a/drivers/gpu/drm/panel/panel-synaptics-r63353.c +++ b/drivers/gpu/drm/panel/panel-synaptics-r63353.c @@ -265,29 +265,11 @@ static int r63353_panel_probe(struct mipi_dsi_device = *dsi) if (ret) return ret; =20 - drm_panel_add(&panel->base); - - ret =3D mipi_dsi_attach(dsi); - if (ret < 0) { - dev_err(dev, "mipi_dsi_attach failed: %d\n", ret); - drm_panel_remove(&panel->base); + ret =3D devm_drm_panel_add(dev, &panel->base); + if (ret) return ret; - } - - return ret; -} - -static void r63353_panel_remove(struct mipi_dsi_device *dsi) -{ - struct r63353_panel *rpanel =3D mipi_dsi_get_drvdata(dsi); - struct device *dev =3D &dsi->dev; - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(dev, "Failed to detach from host (%d)\n", ret); =20 - drm_panel_remove(&rpanel->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static void r63353_panel_shutdown(struct mipi_dsi_device *dsi) @@ -319,7 +301,6 @@ static struct mipi_dsi_driver r63353_panel_driver =3D { .of_match_table =3D r63353_of_match, }, .probe =3D r63353_panel_probe, - .remove =3D r63353_panel_remove, .shutdown =3D r63353_panel_shutdown, }; =20 diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm= /panel/panel-tdo-tl070wsh30.c index fa961abdd2d7..6f975acc0431 100644 --- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c +++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c @@ -150,7 +150,9 @@ static int tdo_tl070wsh30_panel_add(struct tdo_tl070wsh= 30_panel *tdo_tl070wsh30) if (err) return err; =20 - drm_panel_add(&tdo_tl070wsh30->base); + err =3D devm_drm_panel_add(dev, &tdo_tl070wsh30->base); + if (err) + return err; =20 return 0; } @@ -179,19 +181,7 @@ static int tdo_tl070wsh30_panel_probe(struct mipi_dsi_= device *dsi) if (err < 0) return err; =20 - return mipi_dsi_attach(dsi); -} - -static void tdo_tl070wsh30_panel_remove(struct mipi_dsi_device *dsi) -{ - struct tdo_tl070wsh30_panel *tdo_tl070wsh30 =3D mipi_dsi_get_drvdata(dsi); - int err; - - err =3D mipi_dsi_detach(dsi); - if (err < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); - - drm_panel_remove(&tdo_tl070wsh30->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } =20 static struct mipi_dsi_driver tdo_tl070wsh30_panel_driver =3D { @@ -200,7 +190,6 @@ static struct mipi_dsi_driver tdo_tl070wsh30_panel_driv= er =3D { .of_match_table =3D tdo_tl070wsh30_of_match, }, .probe =3D tdo_tl070wsh30_panel_probe, - .remove =3D tdo_tl070wsh30_panel_remove, }; module_mipi_dsi_driver(tdo_tl070wsh30_panel_driver); =20 diff --git a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c b/drivers/gpu= /drm/panel/panel-xinpeng-xpp055c272.c index fc6516373b5d..652c4d71a613 100644 --- a/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c +++ b/drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c @@ -274,30 +274,19 @@ static int xpp055c272_probe(struct mipi_dsi_device *d= si) if (ret) return ret; =20 - drm_panel_add(&ctx->panel); + ret =3D devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; =20 - ret =3D mipi_dsi_attach(dsi); + ret =3D devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(dev, "mipi_dsi_attach failed: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } =20 return 0; } =20 -static void xpp055c272_remove(struct mipi_dsi_device *dsi) -{ - struct xpp055c272 *ctx =3D mipi_dsi_get_drvdata(dsi); - int ret; - - ret =3D mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id xpp055c272_of_match[] =3D { { .compatible =3D "xinpeng,xpp055c272" }, { /* sentinel */ } @@ -310,7 +299,6 @@ static struct mipi_dsi_driver xpp055c272_driver =3D { .of_match_table =3D xpp055c272_of_match, }, .probe =3D xpp055c272_probe, - .remove =3D xpp055c272_remove, }; module_mipi_dsi_driver(xpp055c272_driver); =20 --=20 2.43.0