From patchwork Wed Apr 15 07:39:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11490067 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 269E86CA for ; Wed, 15 Apr 2020 07:41:55 +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 0582420771 for ; Wed, 15 Apr 2020 07:41:55 +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="YFblQluC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0582420771 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 B90AC6E89C; Wed, 15 Apr 2020 07:41:09 +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 DDECB6E88C for ; Wed, 15 Apr 2020 07:40:58 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id x25so16191649wmc.0 for ; Wed, 15 Apr 2020 00:40: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=eMraBtSz7Iti0PpGK7WK3Id6bjGPSlXFbvPkkFzOxJw=; b=YFblQluC1vwuZ6o5RE8DaSn+zkh2crSuHiwq3OcnCTbhxsYfpk7+zpj98PKfuFVPTu EAGF9r8cZVWYezYjCx4qlkyyQJhSP+tZjJJoLVT3HCppl9NCtB5kAXAiivhpzQlVBaNS 5o1sMvQN9EA1WkNMo8UWRTgvNKA9E4nUcYjdM= 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=eMraBtSz7Iti0PpGK7WK3Id6bjGPSlXFbvPkkFzOxJw=; b=LMtXHGDrhxA4HmaqLtNf32LFJwAjSnTI/shYd/kL199gvMzNrjg3DnrCkq0yttYAWT PCUxG2fe+dEpUQhFyW4AtTxKMDYj+UwqTFE+7FcCrvAmfopkQbBqnfYGj20QTlM93uUB gvg6ggckDY4Z3PFY1ej16cEfcjZXlyBZOTDX5571k12r4eyvixoNvfc+rkn8DzBC1buE dosSPGTDJH38+oKhnPRG18+jjpjYxKWxLf/VBZAPiWrjjTJCmUiy1hb2a3B9duLE2Qjm tRQ7gcsZ8mBgh1p6CXf2+ibZwglsTzd2n1Km+21rMg712fZ1X9Ym/W+vXyPW/8ATY8nD XfwA== X-Gm-Message-State: AGi0PuaAWcbX1FWYnPHEMY5wc7guX1o4vRzQlEBHv0aauXO9R56+8DXS kYhnhoopQf00R3hq6TgXlSKg4Q== X-Google-Smtp-Source: APiQypLLdYfPTX2c028SHsK+LS5dOSxF82LM//dq6Z+tVvULZS4yxqUuCDTF417h0/gq2XmW1HyoEg== X-Received: by 2002:a1c:e1c1:: with SMTP id y184mr3860567wmg.143.1586936457560; Wed, 15 Apr 2020 00:40:57 -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.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 00:40:57 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 16/59] drm/mi0283qt: Use devm_drm_dev_alloc Date: Wed, 15 Apr 2020 09:39:51 +0200 Message-Id: <20200415074034.175360-17-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 , 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: Noralf Trønnes Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" --- drivers/gpu/drm/tiny/mi0283qt.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tiny/mi0283qt.c b/drivers/gpu/drm/tiny/mi0283qt.c index decaf57053ff..08ac549ab0f7 100644 --- a/drivers/gpu/drm/tiny/mi0283qt.c +++ b/drivers/gpu/drm/tiny/mi0283qt.c @@ -187,18 +187,13 @@ static int mi0283qt_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, &mi0283qt_driver, + struct mipi_dbi_dev, drm); + if (IS_ERR(dbidev)) + return PTR_ERR(dbidev); dbi = &dbidev->dbi; drm = &dbidev->drm; - ret = devm_drm_dev_init(dev, drm, &mi0283qt_driver); - if (ret) { - kfree(dbidev); - return ret; - } - drmm_add_final_kfree(drm, dbidev); dbi->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(dbi->reset)) {