From patchwork Fri Sep 4 14:39:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11757593 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 A7607618 for ; Fri, 4 Sep 2020 14:41:25 +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 7FFE2206F2 for ; Fri, 4 Sep 2020 14:41:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q9vBknRs"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="SifpAuEm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FFE2206F2 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=cplrjHuEGkXbJYeWt69JvSB0JaaxUtHqtDL5z7tNV3M=; b=q9vBknRsVrKBBRm2KnuWMTHHT kB4BL8WQCnknc+BsIpTOO7/JLedV2R9YYHiXwWsMhgjQWSVT5R1Q1ULH2cnO9CDCJxNUmktQlKuBE HIjbNjpt+lW1e8XQ+Iy2jc+TWx2UQlDKvSQY7xF01JnR5VDioQ+LOSJzJavRAgaqYxVkVV/VG+57F 4O9vqMzQ22Vp1gl5S3qe6mkEn3T8Cm5lWUBQXfGSYBJULQbNzNFrsM1/e9+WvC9cLQsn7K6q8+Cwu 8348OC1Knglk8MzbK54gSy+GhHh7WraNQ5/vemRPkFMlmq0AevwyRDzRGtegFZGvwGSi4VCr7cFy0 FRUENZPgg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kECsn-0005nA-1c; Fri, 04 Sep 2020 14:40:05 +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 1kECsg-0005kP-JE for linux-arm-kernel@lists.infradead.org; Fri, 04 Sep 2020 14:39:59 +0000 Received: by mail-wr1-x443.google.com with SMTP id k15so6966439wrn.10 for ; Fri, 04 Sep 2020 07:39:58 -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=NqrDMWKPVBEXKxMkEUSZRSbvqc8CLg+CwI6i4dEMZeg=; b=SifpAuEmHbqeHebuJLfbshEF0Iu4B2BZVBntxOws9U08eLFFyAe2mBfvc/nb3Gy5ad 7hs3LiSmWIJF/NHjPuc8DNTDP437uOTjEGxnlf+JsJs7cyQ4aYVhkPfquwXxSqbnzwXZ tu4v7bze3q8hgkUxqysmO54qHEupegU/yV/XU= 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=NqrDMWKPVBEXKxMkEUSZRSbvqc8CLg+CwI6i4dEMZeg=; b=FPe08xpetA/WFL/9IYUAiRrPR3fqlC7UtEonMzChmEgckTMH+b+WajFJO8+HniLghJ aDfJ8xQ0Qfins9ca/WZXtYIKM8Ktx3rwTtfrQCQyntol5tMJWywZAKCEKP0bNg8xpfTg 8cSKJw/rNmzNzgTtlwYZEbR4czBJJxc2PTYFV1bMKlWghqBbs46037fdETkVSUGPLe5u b/wVHTnWm9Bp8tgMzmNiIHONvdaFzxHdtz/+l/goPkoT6RVPTPOYzcxC+v8ZRXcDR03c 2CkHC17YNalSkjjh/bkX9BMXG/xr9fNbJrCijDzS3EMIH7MSirBOPTaetioET7wk9ZW6 xw8g== X-Gm-Message-State: AOAM532Y/if+np2jvsXBcAEfku+QOb4AyTMeE9jkeezUf1W5Qh/8+Fcf qh1KmRenb1bJsUVoh+po8q61wA== X-Google-Smtp-Source: ABdhPJwPEJ3BZ3mdyweBni7RP9oc5oU9d4IzFmeXdtvgSBcZxg7k2MoWvJwtXfV3YCbHBT4uIjNA0g== X-Received: by 2002:adf:f8d0:: with SMTP id f16mr8587525wrq.66.1599230397711; Fri, 04 Sep 2020 07:39:57 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z15sm11597949wrv.94.2020.09.04.07.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 07:39:57 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 06/24] drm/xlnx: Use devm_drm_dev_alloc Date: Fri, 4 Sep 2020 16:39:23 +0200 Message-Id: <20200904143941.110665-7-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200904143941.110665-1-daniel.vetter@ffwll.ch> References: <20200904143941.110665-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-20200904_103958_699787_97234B56 X-CRM114-Status: GOOD ( 16.23 ) 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_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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: Hyun Kwon , Daniel Vetter , Intel Graphics Development , Michal Simek , Laurent Pinchart , 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 Gets rid of drmm_add_final_kfree, which I want to unexport so that it stops confusion people about this transitional state of rolling drm managed memory out. This also fixes the missing drm_dev_put in the error path of the probe code. Signed-off-by: Daniel Vetter Cc: Hyun Kwon Cc: Laurent Pinchart Cc: Michal Simek Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index 26328c76305b..80b8edd20442 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c @@ -208,27 +208,16 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) int ret; /* Allocate private data. */ - dpsub = kzalloc(sizeof(*dpsub), GFP_KERNEL); - if (!dpsub) - return -ENOMEM; + dpsub = devm_drm_dev_alloc(&pdev->dev, &zynqmp_dpsub_drm_driver, + struct zynqmp_dpsub, drm); + if (IS_ERR(dpsub)) + return PTR_ERR(dpsub); dpsub->dev = &pdev->dev; platform_set_drvdata(pdev, dpsub); dma_set_mask(dpsub->dev, DMA_BIT_MASK(ZYNQMP_DISP_MAX_DMA_BIT)); - /* - * Initialize the DRM device early, as the DRM core mandates usage of - * the managed memory helpers tied to the DRM device. - */ - ret = drm_dev_init(&dpsub->drm, &zynqmp_dpsub_drm_driver, &pdev->dev); - if (ret < 0) { - kfree(dpsub); - return ret; - } - - drmm_add_final_kfree(&dpsub->drm, dpsub); - /* Try the reserved memory. Proceed if there's none. */ of_reserved_mem_device_init(&pdev->dev); @@ -286,8 +275,6 @@ static int zynqmp_dpsub_remove(struct platform_device *pdev) clk_disable_unprepare(dpsub->apb_clk); of_reserved_mem_device_release(&pdev->dev); - drm_dev_put(drm); - return 0; }