Message ID | 65ebf0513e2836227a9636e922f51c668bd69720.1694767209.git.geert+renesas@glider.be |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp910290vqi; Fri, 15 Sep 2023 02:15:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCVeRU3Cm115+DcCtp0Hqspp1ORKD7LaljJUwxdjp/B5AwGdGx9DZmtI1uYB5TS1lvCnpN X-Received: by 2002:a05:6a00:c96:b0:68f:d864:596 with SMTP id a22-20020a056a000c9600b0068fd8640596mr1242681pfv.3.1694769320875; Fri, 15 Sep 2023 02:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694769320; cv=none; d=google.com; s=arc-20160816; b=G0HZyNCERsFkd/jjyTXni1C43PA9Bff1Hn958siQlw9fYer6EMN97XlXhIbkBvYN+i AbDmPaVvZSfX6IODr2T7h/5woJ+CaQjFVUynxjdfJZ0XqRugqojtHby1igwkWSBIVCGX CpsFxYwDXNlfiM1CEuujAsQkyn9xtA+WWPRTvYW2fVnh0rfGx/smTubkUV9GSy3qWMJA epcsOEjJmYaCVIoumIti+MSVNpI703m2L+BGC78wAA1Y4telRuLNVu7Yhs7Npi1QTVUA 7wOyKibNobeOEfy4zc4E2BOuGPLVnkBlWfsExIRVqMayGEAci5jpyaPYKHYkzanxB3j2 4Yog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bpaH77Da9YHitOYL1AgXz+zAJkPDUZp8tkAQBU11IUc=; fh=5wQWCF8gEfDP7dQFU6OnqlYZzko8ZfxmYVp1pev3Png=; b=Hq/Wny2KP7rPz/ewOx/qjEGdukzjWP0Ktclf25HUgc9rvGxktP6jrSCxNRAhsTcMXQ Vh8dFqvYRJiqIyzFe+A4EUyj3FuBWiYovx31mhBBISFhumlUWssB69u/P1AMFP+5QQlx gUK61Cpn+oR3jK6YXW59fUM36S0rw17SgPrXmxnWz4M/dGNeMbiu7oMLisIyphwonBTB OfzjwPP0W+fTBcSmJyLvKin4X1oiK/0Bam/cihXCL/9s0aiJJRmyeBi69v4YMm+20ZEI ElesNgBP7XMW6M6AO+bDO85UAkn9x3p+aZYfFp5qr6GBBKmIRZKiP60k7fv8CJQckbpQ t/+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x41-20020a056a0018a900b00690158afc83si3045655pfh.274.2023.09.15.02.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 02:15:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1599F822C624; Fri, 15 Sep 2023 01:54:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233393AbjIOIyj (ORCPT <rfc822;ruipengqi7@gmail.com> + 32 others); Fri, 15 Sep 2023 04:54:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233197AbjIOIyZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 15 Sep 2023 04:54:25 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E4C22722 for <linux-kernel@vger.kernel.org>; Fri, 15 Sep 2023 01:54:16 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:7135:da8b:ba1d:1a7c]) by albert.telenet-ops.be with bizsmtp id m8uE2A00j3q21w7068uEYC; Fri, 15 Sep 2023 10:54:15 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qh4aJ-003lH6-L7; Fri, 15 Sep 2023 10:54:14 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qh4ac-00Gdc9-Lg; Fri, 15 Sep 2023 10:54:14 +0200 From: Geert Uytterhoeven <geert+renesas@glider.be> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Thomas Zimmermann <tzimmermann@suse.de>, Magnus Damm <magnus.damm@gmail.com> Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert+renesas@glider.be> Subject: [PATCH v4 19/41] drm: renesas: shmobile: Use drmm_universal_plane_alloc() Date: Fri, 15 Sep 2023 10:53:34 +0200 Message-Id: <65ebf0513e2836227a9636e922f51c668bd69720.1694767209.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1694767208.git.geert+renesas@glider.be> References: <cover.1694767208.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 01:54:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777094435367097697 X-GMAIL-MSGID: 1777094435367097697 |
Series |
drm: renesas: shmobile: Atomic conversion + DT support
|
|
Commit Message
Geert Uytterhoeven
Sept. 15, 2023, 8:53 a.m. UTC
According to the comments for drm_universal_plane_init(), the plane
structure should not be allocated with devm_kzalloc().
Fix lifetime issues by using drmm_universal_plane_alloc() instead.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4:
- No changes,
v3:
- No changes,
v2:
- Split off removal of call to drm_plane_force_disable().
---
.../gpu/drm/renesas/shmobile/shmob_drm_plane.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c index 3a5db319bad14218..1fb68b5fe915b8dc 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c @@ -179,7 +179,6 @@ static int shmob_drm_plane_disable(struct drm_plane *plane, static const struct drm_plane_funcs shmob_drm_plane_funcs = { .update_plane = shmob_drm_plane_update, .disable_plane = shmob_drm_plane_disable, - .destroy = drm_plane_cleanup, }; static const uint32_t formats[] = { @@ -198,19 +197,16 @@ static const uint32_t formats[] = { int shmob_drm_plane_create(struct shmob_drm_device *sdev, unsigned int index) { struct shmob_drm_plane *splane; - int ret; - splane = devm_kzalloc(sdev->dev, sizeof(*splane), GFP_KERNEL); - if (splane == NULL) - return -ENOMEM; + splane = drmm_universal_plane_alloc(sdev->ddev, struct shmob_drm_plane, + plane, 1, &shmob_drm_plane_funcs, + formats, ARRAY_SIZE(formats), NULL, + DRM_PLANE_TYPE_OVERLAY, NULL); + if (IS_ERR(splane)) + return PTR_ERR(splane); splane->index = index; splane->alpha = 255; - ret = drm_universal_plane_init(sdev->ddev, &splane->plane, 1, - &shmob_drm_plane_funcs, - formats, ARRAY_SIZE(formats), NULL, - DRM_PLANE_TYPE_OVERLAY, NULL); - - return ret; + return 0; }