From patchwork Fri Feb 21 21:02:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11397401 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 7A7991580 for ; Fri, 21 Feb 2020 21:04:18 +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 5945A2073A for ; Fri, 21 Feb 2020 21:04:18 +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="OwAeQBHo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5945A2073A 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 652BB6F53B; Fri, 21 Feb 2020 21:04:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84B906F52D for ; Fri, 21 Feb 2020 21:03:50 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id s10so3166529wmh.3 for ; Fri, 21 Feb 2020 13:03:50 -0800 (PST) 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=mt0LsOXPHC2Mb9wycvJ+FxYXLYhKToWbMHDbBuIFXi8=; b=OwAeQBHoXmiqL3qM86BYvSS3mnCumn3/StXzTr+Vtds22QcaVo1o7AFJ84T+zcxoBu K5ZW3TEsMs87VyFy/0nbRZIZNnteigaSa+cbYw62oAsp346lzKGDQ6VIqqZYM4BswuNm bXYD3fZyZs7zhUopDumdB46088eRTH8MXrHWY= 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=mt0LsOXPHC2Mb9wycvJ+FxYXLYhKToWbMHDbBuIFXi8=; b=YASqP1zARaALokwEs2i+qCK8rdp7W4tTovkML5Hi+GeE5CFybz3wzKgTyrFA1FUfD9 uMWSOWTpXg1+2t235fbny67Dz7juUoBCvs/QdgTn3jSxuxoRBTsQ7cBW0wdho5zcj7Df C/cgbfw2NzE8Lz0iVHC++rn1zg9TPJyR2Hp0dCpRLLTr5RcnFPD5BdVUtltAE6/E2zh8 YxmduK2uymJNB+WDc2fWCGOE3F09PWUTs5ctasBKPtbkLCJQiZF8dVYWEnyejH+x9HP9 FvP8MNA4f4PrWp/awl+aLXciMpvFaCHPtYFjxkBz53kMFiWA/bHrk6Hv1WAC/tURhcJe Y+lA== X-Gm-Message-State: APjAAAUruIu4hH2GoyTWjru5HowW3es6EmvGFAZAxRhnORYYbTmffeMx mhUfZ0609MDuMODy/r20Aw/Ifg/gr3A= X-Google-Smtp-Source: APXvYqz2IOfRGizBBQqJEEbmC6Q2Got/tMih3FC8thww8AbrFTm4Vu1e4ml0JQkFYQDcWLGqPZ/YQg== X-Received: by 2002:a1c:e388:: with SMTP id a130mr5606572wmh.176.1582319028854; Fri, 21 Feb 2020 13:03:48 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z6sm5483930wrw.36.2020.02.21.13.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 13:03:48 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 15/51] drm/repaper: Use drmm_add_final_kfree Date: Fri, 21 Feb 2020 22:02:43 +0100 Message-Id: <20200221210319.2245170-16-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200221210319.2245170-1-daniel.vetter@ffwll.ch> References: <20200221210319.2245170-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 , Intel Graphics Development , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With this we can drop the final kfree from the release function. Reviewed-by: Noralf Trønnes Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" --- drivers/gpu/drm/tiny/repaper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index f5ebcaf7ee3a..df5654ef53ee 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -910,13 +911,10 @@ static const struct drm_mode_config_funcs repaper_mode_config_funcs = { static void repaper_release(struct drm_device *drm) { - struct repaper_epd *epd = drm_to_epd(drm); - DRM_DEBUG_DRIVER("\n"); drm_mode_config_cleanup(drm); drm_dev_fini(drm); - kfree(epd); } static const uint32_t repaper_formats[] = { @@ -1024,6 +1022,7 @@ static int repaper_probe(struct spi_device *spi) kfree(epd); return ret; } + drmm_add_final_kfree(drm, epd); drm_mode_config_init(drm); drm->mode_config.funcs = &repaper_mode_config_funcs;