From patchwork Wed Apr 15 07:40:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11490121 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 69A046CA for ; Wed, 15 Apr 2020 07:42:21 +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 4876A20936 for ; Wed, 15 Apr 2020 07:42:21 +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="Gyz+Ctzk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4876A20936 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 6B617896ED; Wed, 15 Apr 2020 07:41:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id F07466E8A1 for ; Wed, 15 Apr 2020 07:41:18 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id h2so16160626wmb.4 for ; Wed, 15 Apr 2020 00:41:18 -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=68pRrV/FcZHhfKF8N6ed2Kst21jlb9WtulkqBRnU6S8=; b=Gyz+CtzkcX37Hl3nRFOLm4GVr0azPRX/NrKG8ap0W4baKemymnbW+Lxwz1Xp6GzRWr lx8lnLIxv1Ol9V12XsfA9QbmLLL+3YuN9Oi/tEmm8esrE92s8XrfhUVGnPj+V2YfEa9U /1rFjd2vFJTcNB51K1Lp7i6tJvkBxa6hlf7kw= 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=68pRrV/FcZHhfKF8N6ed2Kst21jlb9WtulkqBRnU6S8=; b=Y0Tf526xOUWTAXj0BNlL3pKQK7DVe8T9waah9aoVkbr7t7pOGnwZJVcpQs0WtBxVPy m/3TyhE+4srnVyuXrhHQJgqL7jenwFUBpCSxTqUE0I8RkmKEoK6Iyfi3346+670LLsCw R7T7HsOjezyXxwoBmLzzSdvUqcWpnv1Zh11FYVaRAZGsYOrwBOCzLMG7roZ7pubWPMlY 1bK6gIQRr4Z0SHCH/vyzdhNUTGtZRpBR/c60nAkGlvUK6zcn4jJplLtVL5pX8vwXty7r GKSuGRGf84fzKtx7RlyiTeiAJMQ1ohO4JeHSP18BDkwPjaUFlByy9bcQu3MSMP3fKWzc KpzQ== X-Gm-Message-State: AGi0PuZlNmdkcEfody/UL40hCQXEDHudgdAtZGIyHBPhe/ypWdP/qCx1 kiUIJtbFWx7Qq3dn7GEx/xQhyw== X-Google-Smtp-Source: APiQypK5zCrPi1yHK4Hs/xsz2aEThr6qJhfA2NsVnJXgzOw3DJadAR07qQZyjbKa0Tk2q2OD7lnVVg== X-Received: by 2002:a1c:80c3:: with SMTP id b186mr4095533wmd.117.1586936477577; Wed, 15 Apr 2020 00:41:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 00:41:17 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 35/59] drm/cirrus: Use devm_drm_dev_alloc Date: Wed, 15 Apr 2020 09:40:10 +0200 Message-Id: <20200415074034.175360-36-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 , DRI Development , virtualization@lists.linux-foundation.org, Gerd Hoffmann , Thomas Zimmermann , Daniel Vetter , Dave Airlie , Sam Ravnborg , Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Already using devm_drm_dev_init, so very simple replacment. Acked-by: Noralf Trønnes Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: Sam Ravnborg Cc: "Noralf Trønnes" Cc: Rob Herring Cc: Thomas Zimmermann Cc: virtualization@lists.linux-foundation.org Cc: Emil Velikov --- drivers/gpu/drm/cirrus/cirrus.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c index a36269717c3b..4b65637147ba 100644 --- a/drivers/gpu/drm/cirrus/cirrus.c +++ b/drivers/gpu/drm/cirrus/cirrus.c @@ -567,18 +567,13 @@ static int cirrus_pci_probe(struct pci_dev *pdev, return ret; ret = -ENOMEM; - cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); - if (cirrus == NULL) - return ret; + cirrus = devm_drm_dev_alloc(&pdev->dev, &cirrus_driver, + struct cirrus_device, dev); + if (IS_ERR(cirrus)) + return PTR_ERR(cirrus); dev = &cirrus->dev; - ret = devm_drm_dev_init(&pdev->dev, dev, &cirrus_driver); - if (ret) { - kfree(cirrus); - return ret; - } dev->dev_private = cirrus; - drmm_add_final_kfree(dev, cirrus); cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));