Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1405513rdb; Wed, 16 Aug 2023 10:23:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbP60OQOp8y2glukg5JuHH91LHXNd4taDwQZZLOTZ/yCL1H2t6cX+ElstMy7OIcxZacyyv X-Received: by 2002:a17:902:680e:b0:1bb:ad56:a831 with SMTP id h14-20020a170902680e00b001bbad56a831mr2460620plk.36.1692206589169; Wed, 16 Aug 2023 10:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692206589; cv=none; d=google.com; s=arc-20160816; b=S3df/izg3hk23coiGKJWI14uMMkHBbteH0E33WLu2p3fJBoYH/F0DpaxYfoSZZKHyT 6wcgLfxMpo+YhUia/ERJQwWDhFHxik560vsa6R6W92pueGvIu7vEmHYC1M68xai1PeOr WoH4T0QNjWSfCgEA7QsC9hkOovWZ8x5AxsYizyj3BjMUmWIGy/echMsifBdKr8uXcTbw TH6Hol0wublKL4iTPAS95rZcuyYi2FR5vktNQVUFYYlE2PQ0fo0SatL/YJ7aPldT1A6h Vx3QOuoIOMH06NtuyUxKBVSNdhxqj2EEQzjbrecsb6P7CIF235uhTH/RtAjCrHezhnp4 UTWw== 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=XzNHzA6IKLnFvYe0upec51OdhMCgXwdj6ak/isLse5c=; fh=UWUHlpYIyaM7sVynBT5Ky7qldVK8D81neqNGmwj4p+c=; b=ZhYhyT4FeoLrRd1bqWj+ldZFnD6CJTAZxyCuQGx8kPYTZp/SyolOxUNwuR27whwfH1 Z6/ExWbkIG3G6zyqVAN4fS+3d6QlzW1088ax7Bt8dZZiLim/gLLvUua/8D1yAP1VIB3V G74SY2TanIPkmXvWfJeW5CNpQpljm/vQ8WYHoqqcTflrPsioxo2zluum9zv5TkDt5KsD e6N1fUCFKnwnGT0ffVfpknAPBQqcJQaWAtPjFqVqN7TdtTp1IYAkbwu0pw1ZFYEY5tim 6OUzYu5gi90ItAV7cvaBJYnDhpZ1KFSEqX2LwZV2i1+cgxKTOhY9zmhbgEYz84+Jzhzn IkNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a170903110c00b001ac6d4e1d72si11900118plh.149.2023.08.16.10.22.49; Wed, 16 Aug 2023 10:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243982AbjHPKpG (ORCPT + 99 others); Wed, 16 Aug 2023 06:45:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244039AbjHPKpA (ORCPT ); Wed, 16 Aug 2023 06:45:00 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1CE2D64 for ; Wed, 16 Aug 2023 03:44:42 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5d0c:f209:12a7:4ce5]) by andre.telenet-ops.be with bizsmtp id aAkh2A00J45ualL01AkhCr; Wed, 16 Aug 2023 12:44:41 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qWE0w-000osG-Pn; Wed, 16 Aug 2023 12:44:41 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWDAw-00675c-OC; Wed, 16 Aug 2023 11:50:50 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 19/41] drm: renesas: shmobile: Use drmm_universal_plane_alloc() Date: Wed, 16 Aug 2023 11:50:26 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- 2.34.1