From patchwork Fri Jul 17 09:04:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11669627 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A45EA159A for ; Fri, 17 Jul 2020 09:07:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C023206F4 for ; Fri, 17 Jul 2020 09:07:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wq7uycNc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="kge1RFcN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C023206F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Sl/xgmRYArSxrnfHQ5/MN917moGJtKQT2ZaI0VCEOBA=; b=wq7uycNco4d6DdgdT1W/NmnrK zT0AFiK02KOobFXTK4Smul+DceoPmohpnzMB4SbRbLI9T8NzR7ZmcgvT/ZfebATXvD8bnxT5/ksWE OWJKvUmBlfe6/EN/KuWhQ++T7VNZjuEsUMRky5N0oZeWcAMGq96RKkbRSgBv4BmSahQiwWpjuxCy6 jp20/NE5JOKfRlqKmsJC38iG4jcFAtfCnAUj/abQbWDkLkx7skWikn/saDCZ2AiZobz9wb8l7mvUm FzkSxRb2I2hHdDxkvM0j8okMNn7Y7v1VikB5lhsDwvPb+M1JQdiC7XM0/wnf40qhTS48Br62zLVnQ T3cuHe7+A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwMJS-0005UG-EW; Fri, 17 Jul 2020 09:05:50 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwMIX-000545-BC for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2020 09:04:57 +0000 Received: by mail-wr1-x443.google.com with SMTP id s10so10137582wrw.12 for ; Fri, 17 Jul 2020 02:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+PgYCTE9+86LL8hmpo3wNDvQ3MAJhOxmPWFQosNnkp0=; b=kge1RFcNb3MA3gqeJzyuV24hUc8Wuu5d52T2gwyiKPKlVVFuua5swyDy6DIhvkNK5V O7aHOHvHI2g+W6rPUxi9EK/wSmgHDfpELQi/FWldTxF4LA5hKnx2XUn/hJYTg+GvKjKs 0ppARKzGJPOZVBBk6nxakp5DLfoTkaBi9D+gU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+PgYCTE9+86LL8hmpo3wNDvQ3MAJhOxmPWFQosNnkp0=; b=iVQtyBvw4q4vpespeOyOK2jbm+TInzQISEGviupH4idAGaXuNIkfMjlKcM8HSQ/tcz ztqBADCXK/V8cyteUkteWcnYzV39oE5yIt5wiza1IYaS8FIIaZshk7fkqokXUtTVfYct HY2uJ9JNqC8QtwVZ8k91F1DwVoTUYfM753+otV8+fKBPeOSGzExp7p3tZgpAfbR0+/QR HA3Kuz0bu/ShwinSDFRIwE5LJEEIvai3rUauVlxE+3M8fKDCCZ3dVFYKLdPKxa1RvTbL UP/8M7p2VkjRClhdONYnBQXduIYt62DM1BOFNohf5qv3b8kxf4LmbBSUqhz5zWk+NyoR GS8w== X-Gm-Message-State: AOAM530pxnhzjhHonhk2020vbw9zvKiY0r2DXMBSuSaPFe/AfTNv9n8a 8+j6o1+SZ0WJB3v8IiKg3nvxqogmY7w= X-Google-Smtp-Source: ABdhPJy+91Soji71zWg4yMwSROun4xr6l/lazz9FI4nvDy4dRbGGruyC/WVVdgCNY4lq5iOhkRtW/w== X-Received: by 2002:adf:fe4b:: with SMTP id m11mr9095443wrs.36.1594976692331; Fri, 17 Jul 2020 02:04:52 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l67sm14520833wml.13.2020.07.17.02.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 02:04:51 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 18/18] drm/aspeed: Use managed drmm_mode_config_cleanup Date: Fri, 17 Jul 2020 11:04:30 +0200 Message-Id: <20200717090430.1146256-18-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717090430.1146256-1-daniel.vetter@ffwll.ch> References: <20200717090430.1146256-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200717_050453_528764_37F7A9AA X-CRM114-Status: GOOD ( 13.70 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aspeed@lists.ozlabs.org, Andrew Jeffery , Daniel Vetter , Joel Stanley , Daniel Vetter , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since aspeed doesn't use devm_kzalloc anymore we can use the managed mode config cleanup. Signed-off-by: Daniel Vetter Cc: Joel Stanley Cc: Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index 903f4f304647..0e19523f2a06 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -63,15 +63,15 @@ static const struct drm_mode_config_funcs aspeed_gfx_mode_config_funcs = { .atomic_commit = drm_atomic_helper_commit, }; -static void aspeed_gfx_setup_mode_config(struct drm_device *drm) +static int aspeed_gfx_setup_mode_config(struct drm_device *drm) { - drm_mode_config_init(drm); - drm->mode_config.min_width = 0; drm->mode_config.min_height = 0; drm->mode_config.max_width = 800; drm->mode_config.max_height = 600; drm->mode_config.funcs = &aspeed_gfx_mode_config_funcs; + + return drmm_mode_config_init(drm); } static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data) @@ -144,7 +144,9 @@ static int aspeed_gfx_load(struct drm_device *drm) writel(0, priv->base + CRT_CTRL1); writel(0, priv->base + CRT_CTRL2); - aspeed_gfx_setup_mode_config(drm); + ret = aspeed_gfx_setup_mode_config(drm); + if (ret < 0) + return ret; ret = drm_vblank_init(drm, 1); if (ret < 0) { @@ -179,7 +181,6 @@ static int aspeed_gfx_load(struct drm_device *drm) static void aspeed_gfx_unload(struct drm_device *drm) { drm_kms_helper_poll_fini(drm); - drm_mode_config_cleanup(drm); } DEFINE_DRM_GEM_CMA_FOPS(fops);