From patchwork Wed Apr 15 07:40:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11490101 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 311D96CA for ; Wed, 15 Apr 2020 07:42:09 +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 0FDE4206D9 for ; Wed, 15 Apr 2020 07:42:09 +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="dXEUJbhW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FDE4206D9 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 907D4891BA; 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-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id C733E6E8B5 for ; Wed, 15 Apr 2020 07:41:13 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id a81so17655561wmf.5 for ; Wed, 15 Apr 2020 00:41:13 -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=zYsyCYlUTNp19HneBY4lXiaAEzda+/qQSjN5TCET0Jg=; b=dXEUJbhWzX558pMiChWHVq1ZBWdSwgZ2BZKiaSb2GQ0/EUCofZHR8jKb74TgQPKFWv Ozvkl3TWECaHXrpA87Sh9a65Urag+pqKk78QmYsyTtKe561emurRPNw/Eh1EG1ki7nxv mtn07WyFmXGbQnjwuQad4ZFWnxe6kk1Zpcz1E= 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=zYsyCYlUTNp19HneBY4lXiaAEzda+/qQSjN5TCET0Jg=; b=EdEMxGwZ2U+U1SDHEK9c/rXKkE5m3fW3+coRWi/c8c2o/oZVPBeaCmhCTJReb7brLU El4wXlo8UBCSX+PMm8IKpeR580V/18iUeijg4rwNogYKOyi/yeKXTqM8vH9eN6MMSqVY D4wcfmqTPU0h7yNs54F59BvBV4A7FaxzeEnPXkuKXMbOXsGtqy/FVr3KBXJGIXG316qw 4ECyFEh7WVwbWf+dPpt7wlkATKiqKcsSUGtwgJl36Eqp70F2yBf5HBEbdCykMGsWBf1G gK6NEKAgmeNXrXABAiG9a8VUyjZgvpnF8jDEYO7DbWeAoVsULdb8f04jmJIPUjoKpFTp aAMQ== X-Gm-Message-State: AGi0PuZCNkBnsLFU0h108QVsjLFzPty29+VzIc24cR4XqTIqAogHfXaX H4E9XUtUAGuaOW/1oqHv/DLXUQ== X-Google-Smtp-Source: APiQypI+UCF6z3vFSUDWwFiaq6Ltv77FkhIClEqxG1fuQrPeC7TZGX/UeP0t05C6iIQO3JfFBaATsw== X-Received: by 2002:a1c:6a17:: with SMTP id f23mr3626897wmc.136.1586936472416; Wed, 15 Apr 2020 00:41:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 00:41:11 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 30/59] drm/ingenic: Use devm_drm_dev_alloc Date: Wed, 15 Apr 2020 09:40:05 +0200 Message-Id: <20200415074034.175360-31-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: Paul Cercueil , 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. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Paul Cercueil --- drivers/gpu/drm/ingenic/ingenic-drm.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c index 24cc3587cea5..2dd1f3020fcb 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c @@ -611,9 +611,10 @@ static int ingenic_drm_probe(struct platform_device *pdev) return -EINVAL; } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; + priv = devm_drm_dev_alloc(dev, &ingenic_drm_driver_data, + struct ingenic_drm, drm); + if (IS_ERR(priv)) + return PTR_ERR(priv); priv->soc_info = soc_info; priv->dev = dev; @@ -622,13 +623,6 @@ static int ingenic_drm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - ret = devm_drm_dev_init(dev, drm, &ingenic_drm_driver_data); - if (ret) { - kfree(priv); - return ret; - } - drmm_add_final_kfree(drm, priv); - ret = drmm_mode_config_init(drm); if (ret) return ret;