From patchwork Wed Apr 15 07:40:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11490149 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 40909174A for ; Wed, 15 Apr 2020 07:42:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 1F132206D9 for ; Wed, 15 Apr 2020 07:42:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="VPLkjBvD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F132206D9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4651F89852; Wed, 15 Apr 2020 07:41:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD10C6E8A6 for ; Wed, 15 Apr 2020 07:41:11 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id y24so17673444wma.4 for ; Wed, 15 Apr 2020 00:41:11 -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=8pNkHhFd1LMKUnffKElCqpL6Yw/TeF8VvxrZLC1hFeA=; b=VPLkjBvDmctAg2OYVppd2VBZAafMbLpBBx6d33KuCo4fH61hkA5n7yp24ZVZnS0XWO 8xIxaculrBucOVnGuZyTSrXOApaAz7quf40oe7jeUvLGsm9ppRV8SYOnmNMzwVvDITKw sbgRVF0EoX9HVYIRq5YcPtAZywvK+A/MBTolo= 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=8pNkHhFd1LMKUnffKElCqpL6Yw/TeF8VvxrZLC1hFeA=; b=lvBjn+hqUKeXUl+YdTnqOXQHpJA2t6ZHTIWWdgJ/0koJmCo4EHseoOz2zfwjMuIli7 rWZCrOVNrcEtI3A7Qi5fAZ2SH+gQ35tUw1HPSqzea3y/HextJFvaG3wCQ3/r/Sz5jOGh 8TkL0WB+7nirUFzEmhBKfQPq1j5bI5zackWHVwn8VTI+DMDYZ3pEmt6S0p6Ug77VIl0X ILn/NdOif+ltPIQVeAPSr4MXPrziOO14Sc+JKmvNIZVXCkEpS4vdhUGb7czY3EqjjpSl iSEE1nwJmbEFoWLL5h1sx71OMxCh5cFrwmAv6UUUoJKc8yyaXSm9e3GiUIgYPia/lulc UQ0A== X-Gm-Message-State: AGi0PuYFW6yzwY4tNInNAKZQ2pmoNsvrTIIhadRylSkFM/epGae80r+G AGcJC1XQpasOKotbkzE/r5ThzA== X-Google-Smtp-Source: APiQypLExqQezL90Iwy+jU6nEraSJwrGpPL+HQPrh8XyL4U3QAwtTR0rioJrNAbPLTa8M5Acjyqj3w== X-Received: by 2002:a1c:e1c1:: with SMTP id y184mr3861432wmg.143.1586936470328; Wed, 15 Apr 2020 00:41:10 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id u30sm1878552wru.13.2020.04.15.00.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 00:41:09 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 28/59] drm/mcde: Use devm_drm_dev_alloc Date: Wed, 15 Apr 2020 09:40:03 +0200 Message-Id: <20200415074034.175360-29-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200415074034.175360-1-daniel.vetter@ffwll.ch> References: <20200415074034.175360-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Sam Ravnborg , DRI Development , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Already using devm_drm_dev_init, so very simple replacment. v2: Move misplaced double-assignement to next patch (Sam) Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Linus Walleij Reviewed-by: Linus Walleij --- drivers/gpu/drm/mcde/mcde_drv.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index 88cc6b4a7a64..22003478db2c 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -307,19 +307,12 @@ static int mcde_probe(struct platform_device *pdev) int ret; int i; - mcde = kzalloc(sizeof(*mcde), GFP_KERNEL); - if (!mcde) - return -ENOMEM; - mcde->dev = dev; - - ret = devm_drm_dev_init(dev, &mcde->drm, &mcde_drm_driver); - if (ret) { - kfree(mcde); - return ret; - } + mcde = devm_drm_dev_alloc(dev, &mcde_drm_driver, struct mcde, drm); + if (IS_ERR(mcde)) + return PTR_ERR(mcde); drm = &mcde->drm; drm->dev_private = mcde; - drmm_add_final_kfree(drm, mcde); + mcde->dev = dev; platform_set_drvdata(pdev, drm); /* Enable continuous updates: this is what Linux' framebuffer expects */