Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4015440ybd; Tue, 25 Jun 2019 12:28:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0XtwqBGPiDNCr0jc2ux/CT7Rqg6vAmieTJpEE9ud1r4WN8Xuoc0+GTVfJo/FwstaUQfcD X-Received: by 2002:a17:902:7448:: with SMTP id e8mr387380plt.222.1561490939097; Tue, 25 Jun 2019 12:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561490939; cv=none; d=google.com; s=arc-20160816; b=btJprnZM91gMN6cGiNhT77LWvXf/kp4gMXSifBo9mK8rv5tzsPZNNhXEJrHq9Bn966 k6SdelrUvZTv8UvwGwjVqE981YnoxupfsmcCXauwqWrj6CbxFRjV1iPXNWBKxzeC0Bsm P0V0TnW51cfa2lJ9xIKNe25EAJ4jt3EvsYuDmn02k2l2L4A8l5KI5Wk4D4moq4XM+oQT 8z6ZRLxHX336DtAyWRDJSESHLJ5EIGWQnrY9frtNU36Z9b8QfoG8HtPgxXmrCs+tEjOE 5JV2NKJmxw0f03MCBojIMFxOp4m9FCcwNhB7PDXOdGucXDuklQzN1hIMbHNaTMoNPrcs urKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ga+YwIrD2LqYZ2tJvuqiZTtIXkFbIASL3x6BxdYUV7E=; b=okp5NhodIL40PppwLekff/vsbdQUCDTOVGY3Eog2KGEdV/Q+0cwnPxdQC5lDGJ51eh vEOaIy+2piZ/jQozyyE6fnLFeuYSWMASSwAHN+XYa3pBkRDWBM47XOcd3au4z4FEk7NP 6cXB6Un1TyuAZrAc7X7Co3EsDp/hVqyJSIsxh+9DxHx21UbT2MdJeintEJMQA9cfHR2k hYI5BxV4rUOqCCUjW6u9kB4x//BDhsuGDkryBwrR+hB9qCwOB+kyOqmtJ2TKBfJWnmvi XUMupMnbKCBh8oAYaX3MC6U5jz9QtmVr4zM7xQR61ji5BqdMSZHoiknpHuDcEWVCtKud cj6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="AHkej/B1"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r204si7322362pgr.243.2019.06.25.12.28.43; Tue, 25 Jun 2019 12:28:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="AHkej/B1"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731782AbfFYQfM (ORCPT + 99 others); Tue, 25 Jun 2019 12:35:12 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:32782 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731640AbfFYQfI (ORCPT ); Tue, 25 Jun 2019 12:35:08 -0400 Received: by mail-wr1-f67.google.com with SMTP id n9so18683196wru.0 for ; Tue, 25 Jun 2019 09:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ga+YwIrD2LqYZ2tJvuqiZTtIXkFbIASL3x6BxdYUV7E=; b=AHkej/B1mfm2h6OHO9LRjul+QcnubPRDTF056QLWkadd6YmPrnjIQ0undO3cGCLteJ vDiXd6NaEvKkuA/Ov1EU6GibR2fq54JcogmaTLJSE1w8VxFhBCKMQa6nMSc7ama2AQUQ MXjYRzIQXao10HPHfkljNhFskfJ1miN0PiAO2WXQdrS+ZTVMirEH1Q6Xpg47b+c9njcv +AACxr8d7oedC2TVbLqVhCM7LVV6mcxDlsoJqTfbUea3qLJwtE8gHdguCFLj0gCiAbWC v37fEvz+TIlhi8gACKPDc1wJUhIQBhzZpszZhnPvYhMiEv2bxIIzjLBufGN9GEE3sxzT cfTA== 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=ga+YwIrD2LqYZ2tJvuqiZTtIXkFbIASL3x6BxdYUV7E=; b=UT08yQ/5+vz5laaT4OYPNDAQn/BQt+HCC5ze4ApbUmmqWJEY1WspjCHlbWR4p5BAep knvo2I8zAq+MrCO+nxPQDuFxN53Bm5y5Nmn7zGgk0iN1UxQCybIdL6M/MhL9ExlU/hGw UWaRUYxq6hVuh6e9zOkoWfVJkerQxhZRwMPAy9YfIfAKHVIWTYarbkCAm8JxgAlq80aE 5rrH7U1Ra5RObslkQ0Ma/MvumcCqiiZKFHsZkAEaWj6qNHMqFZSfyY017Jx+46KtjdIm eqFUkQ1PCEeYwiP3RBHCBELRZS9/Q1rpQolk6ib/yhfzdEmSPIicLaHs9sHJ/ONIZPDw /ktg== X-Gm-Message-State: APjAAAWI5c1eH/uj+HbzTQDe9w1r1yoe6rZt+Xf5v0I+12qIfd8xHO5L xEJKnTEbBhyohstb2DlIvtQ9kclR6mo= X-Received: by 2002:a5d:528b:: with SMTP id c11mr299403wrv.25.1561480506602; Tue, 25 Jun 2019 09:35:06 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id g8sm2683795wme.20.2019.06.25.09.35.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 09:35:06 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , David Lechner , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 12/12] fbdev: da8xx: use resource management for dma Date: Tue, 25 Jun 2019 18:34:34 +0200 Message-Id: <20190625163434.13620-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190625163434.13620-1-brgl@bgdev.pl> References: <20190625163434.13620-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Use managed variants of dma alloc functions in the da8xx fbdev driver. Signed-off-by: Bartosz Golaszewski --- drivers/video/fbdev/da8xx-fb.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index 6b11a8108108..22f79b3c2326 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1087,10 +1087,6 @@ static int fb_remove(struct platform_device *dev) unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); - dma_free_coherent(par->dev, PALETTE_SIZE, par->v_palette_base, - par->p_palette_base); - dma_free_coherent(par->dev, par->vram_size, par->vram_virt, - par->vram_phys); pm_runtime_put_sync(&dev->dev); pm_runtime_disable(&dev->dev); framebuffer_release(info); @@ -1428,10 +1424,10 @@ static int fb_probe(struct platform_device *device) par->vram_size = roundup(par->vram_size/8, ulcm); par->vram_size = par->vram_size * LCD_NUM_BUFFERS; - par->vram_virt = dma_alloc_coherent(par->dev, - par->vram_size, - &par->vram_phys, - GFP_KERNEL | GFP_DMA); + par->vram_virt = dmam_alloc_coherent(par->dev, + par->vram_size, + &par->vram_phys, + GFP_KERNEL | GFP_DMA); if (!par->vram_virt) { dev_err(&device->dev, "GLCD: kmalloc for frame buffer failed\n"); @@ -1449,20 +1445,20 @@ static int fb_probe(struct platform_device *device) da8xx_fb_fix.line_length - 1; /* allocate palette buffer */ - par->v_palette_base = dma_alloc_coherent(par->dev, PALETTE_SIZE, - &par->p_palette_base, - GFP_KERNEL | GFP_DMA); + par->v_palette_base = dmam_alloc_coherent(par->dev, PALETTE_SIZE, + &par->p_palette_base, + GFP_KERNEL | GFP_DMA); if (!par->v_palette_base) { dev_err(&device->dev, "GLCD: kmalloc for palette buffer failed\n"); ret = -EINVAL; - goto err_release_fb_mem; + goto err_release_fb; } par->irq = platform_get_irq(device, 0); if (par->irq < 0) { ret = -ENOENT; - goto err_release_pl_mem; + goto err_release_fb; } da8xx_fb_var.grayscale = @@ -1480,7 +1476,7 @@ static int fb_probe(struct platform_device *device) ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); if (ret) - goto err_release_pl_mem; + goto err_release_fb; da8xx_fb_info->cmap.len = par->palette_sz; /* initialize var_screeninfo */ @@ -1534,14 +1530,6 @@ static int fb_probe(struct platform_device *device) err_dealloc_cmap: fb_dealloc_cmap(&da8xx_fb_info->cmap); -err_release_pl_mem: - dma_free_coherent(par->dev, PALETTE_SIZE, par->v_palette_base, - par->p_palette_base); - -err_release_fb_mem: - dma_free_coherent(par->dev, par->vram_size, par->vram_virt, - par->vram_phys); - err_release_fb: framebuffer_release(da8xx_fb_info); -- 2.21.0