From patchwork Wed Apr 15 07:39:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11490049 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 0A5136CA for ; Wed, 15 Apr 2020 07:41:47 +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 DCAB920771 for ; Wed, 15 Apr 2020 07:41:46 +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="FLkbXNCa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCAB920771 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 18EC36E87E; Wed, 15 Apr 2020 07:41:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4244C6E889 for ; Wed, 15 Apr 2020 07:41:03 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id k1so10648717wrx.4 for ; Wed, 15 Apr 2020 00:41:03 -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=FoCcPJgxLCMumcla6Kq5B0fQKqpfJGcLuflkgXPteSs=; b=FLkbXNCaeuA1NUP0hDBWW2JwZeeiX1UEXkAbFJy4E5Kd4VPIyFhj1s84/P/ow8Irk7 cezK9FSaz6SPinXLu88JAe0TNtWc3ArPu9XYiphh5+zhUUQWdmRD2E2uUOXS8uJ9LcBb Bys7DYLtt6yVP9tm8UBflULjpOqjVPMK9rdxQ= 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=FoCcPJgxLCMumcla6Kq5B0fQKqpfJGcLuflkgXPteSs=; b=WHXrp3FtUMHENk4vQ21YSn/Ju0d85tSnEZSMMT5gtIqid0brSuA45ao0mUBeaKnC5b AV7xptG4ZHNLqUbSgh7V2TimDXTjM7WXCz3+eqSz/0G4aq5wvP+HqwcrVu8QL2wG4yCq RB+l33/N5xaPg2VikO03zxbPOz6JpsGEXngNWfeudosijzg9PmvKo8VsvCj2V5jZO3q7 HSjdsEO4FJhsFv7ykgwNT91hiw4PN2WizuEY5qba3Zb5Z272c+yoBdJFkaKsxgulGx4r h68gQ30kV+hXNjBv/MArnxoWDw6RYmAjOEkV7lwtg8XuI1qy+vE78d957XsTUSc+fYl6 f4MQ== X-Gm-Message-State: AGi0PuaOVX893F/0+LB8iw5Aja1INPr09Car13bPi4eSZmnsTGddVw23 2JG/UxCyYN7pBXQbe17sumzCRg== X-Google-Smtp-Source: APiQypLESpy/gqNyQD5ttOiGzYI6N0cR4raPJ++yTG5m4b1i1PMgb2w/zTnPYZMg9F/SpW8Tq3UzvQ== X-Received: by 2002:adf:cd0a:: with SMTP id w10mr13671838wrm.404.1586936461935; Wed, 15 Apr 2020 00:41:01 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 00:41:01 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 20/59] drm/hx8357d: Use devm_drm_dev_alloc Date: Wed, 15 Apr 2020 09:39:55 +0200 Message-Id: <20200415074034.175360-21-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 , Daniel Vetter , Sam Ravnborg , DRI Development Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Already using devm_drm_dev_init, so very simple replacment. Acked-by: Eric Anholt Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Eric Anholt --- drivers/gpu/drm/tiny/hx8357d.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c index af7f3d10aac3..b4bc358a3269 100644 --- a/drivers/gpu/drm/tiny/hx8357d.c +++ b/drivers/gpu/drm/tiny/hx8357d.c @@ -226,17 +226,12 @@ static int hx8357d_probe(struct spi_device *spi) u32 rotation = 0; int ret; - dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL); - if (!dbidev) - return -ENOMEM; + dbidev = devm_drm_dev_alloc(dev, &hx8357d_driver, + struct mipi_dbi_dev, drm); + if (IS_ERR(dbidev)) + return PTR_ERR(dbidev); drm = &dbidev->drm; - ret = devm_drm_dev_init(dev, drm, &hx8357d_driver); - if (ret) { - kfree(dbidev); - return ret; - } - drmm_add_final_kfree(drm, dbidev); dc = devm_gpiod_get(dev, "dc", GPIOD_OUT_LOW); if (IS_ERR(dc)) {