Message ID | 20200415074034.175360-36-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=FYuf=57=lists.freedesktop.org=dri-devel-bounces@kernel.org> 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 <patchwork-dri-devel@patchwork.kernel.org>; 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 <patchwork-dri-devel@patchwork.kernel.org>; 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 <dri-devel@lists.freedesktop.org>; Wed, 15 Apr 2020 07:41:18 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id h2so16160626wmb.4 for <dri-devel@lists.freedesktop.org>; 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 <daniel.vetter@ffwll.ch> To: Intel Graphics Development <intel-gfx@lists.freedesktop.org> 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 <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, DRI Development <dri-devel@lists.freedesktop.org>, virtualization@lists.linux-foundation.org, Gerd Hoffmann <kraxel@redhat.com>, Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter <daniel.vetter@intel.com>, Dave Airlie <airlied@redhat.com>, Sam Ravnborg <sam@ravnborg.org>, Emil Velikov <emil.velikov@collabora.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
devm_drm_dev_alloc, v2
|
expand
|
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));