Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1055624rwd; Tue, 13 Jun 2023 04:22:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ucslXtaPlc2km0sSWG9U2Al/wCRjM7k49axbHcXoJ39Bre7QfERAGeTr54CS54IDrf9S+ X-Received: by 2002:a05:6870:e150:b0:195:9ef5:3f53 with SMTP id z16-20020a056870e15000b001959ef53f53mr7535684oaa.10.1686655348933; Tue, 13 Jun 2023 04:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655348; cv=none; d=google.com; s=arc-20160816; b=EH1NWgUbsvNqNlfB8Xi+Z0gbCWQ88wXCodiOtvHIHgcS5xED9feQV7q2cv9fX/6b6W BSHYsVGZ1XkChS9ExqFYxeMua/MjuKZlEt5IA20VabBTmSI9niOE2Y0IAkPXWv0mckHu 4K2+a4rHtwzOHOQN1S5DCNXwL8w1LPjAragUJUK8UK12UFvzNin8ykA+8Ux3Z534K6k7 UEqjPljfxWb1+9+hy3jVYxqxhECXzAuGYVBbCekATNVHtzd4iJaKLvDoCspaR0hKEjsD u2nzmtPvNl9YNe2pHYZAAlc4oJhjp5D/Evikfqs6ctm4CJB9CCN/TTBBmy/fm5QgioZV 8HJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=XZq7uuC2nsDif+K+IT1h1suAjzRhQ7TghVnMjkbiuGw=; b=KXpBZsut3glkqSH1hcEI8TKsP2KSmWUZeEbPFzc1UrGjogXJFLrxiJ0c0vgImKIDlu l3/T2dwSIGWowPW/+QXn8Co38C/lxPWXSANi6hADkEjLpH94vcVUcdNekqORzITrFhzf 8lylUjtY38dyKYqQPEl5wZQ9XbJXgwJMQi02LANM5lnDjC8jqQB3EdOtWfI2MHukXBI4 qTz19NjgaamtZ2Go8WT61EYLRhnnHqKhge/fhyn8OF5Dr/EARFWZL8PkpuOJDpvLQsZ6 XES89if8cyXFZ6E4OOBj3crqmBcdKjbey9lrOTSZosozXqdKySrW5IsuqmmV8LH3+Df6 VpGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wMI4M08z; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020aa79561000000b00652eb995b4dsi4483777pfq.299.2023.06.13.04.22.16; Tue, 13 Jun 2023 04:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wMI4M08z; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242201AbjFMLL7 (ORCPT + 99 others); Tue, 13 Jun 2023 07:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242121AbjFMLKH (ORCPT ); Tue, 13 Jun 2023 07:10:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EC5A10D8; Tue, 13 Jun 2023 04:10:06 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1243A22433; Tue, 13 Jun 2023 11:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686654605; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZq7uuC2nsDif+K+IT1h1suAjzRhQ7TghVnMjkbiuGw=; b=wMI4M08z+h8WOHtDR4vdZ1pZcc6xE415PsiqLphJyVJk0ALCidw6yjDGajMIpea5QXw3el LbruFCKCJmg28Y706Qpr9KCrkLU1xsuOUsMXVl6/yKOe6dtKS81+9QIGA4bZX4uoKjt/bG ixmn2BHImoFXWzNwWr0CXxmn16NouLo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686654605; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZq7uuC2nsDif+K+IT1h1suAjzRhQ7TghVnMjkbiuGw=; b=9lBBsdpC1od6KX4bQ1V3b7E05G7pp1oYKu/NxM/3FUvJPxlP9L1hcIWo4LmJEu7XXmiUPh qoC49pEJGgBA7jCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BA50313A47; Tue, 13 Jun 2023 11:10:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YOKaLIxOiGR8CQAAMHmgww (envelope-from ); Tue, 13 Jun 2023 11:10:04 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, javierm@redhat.com, sam@ravnborg.org, deller@gmx.de, geert+renesas@glider.be, lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, dan.carpenter@linaro.org, michael.j.ruhl@intel.com Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sh@vger.kernel.org, linux-omap@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v3 27/38] fbdev/sh7760fb: Alloc DMA memory from hardware device Date: Tue, 13 Jun 2023 13:07:02 +0200 Message-ID: <20230613110953.24176-28-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230613110953.24176-1-tzimmermann@suse.de> References: <20230613110953.24176-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pass the hardware device to the DMA helpers dma_alloc_coherent() and dma_free_coherent(). The fbdev device that is currently being used is a software device and does not provide DMA memory. Also update the related dev_*() output statements similarly. Signed-off-by: Thomas Zimmermann --- drivers/video/fbdev/sh7760fb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c index 65e2c71cf5b51..74543a1e30314 100644 --- a/drivers/video/fbdev/sh7760fb.c +++ b/drivers/video/fbdev/sh7760fb.c @@ -359,7 +359,7 @@ static void sh7760fb_free_mem(struct fb_info *info) if (!info->screen_base) return; - dma_free_coherent(info->dev, info->screen_size, + dma_free_coherent(info->device, info->screen_size, info->screen_base, par->fbdma); par->fbdma = 0; @@ -408,14 +408,14 @@ static int sh7760fb_alloc_mem(struct fb_info *info) if (vram < PAGE_SIZE) vram = PAGE_SIZE; - fbmem = dma_alloc_coherent(info->dev, vram, &par->fbdma, GFP_KERNEL); + fbmem = dma_alloc_coherent(info->device, vram, &par->fbdma, GFP_KERNEL); if (!fbmem) return -ENOMEM; if ((par->fbdma & SH7760FB_DMA_MASK) != SH7760FB_DMA_MASK) { sh7760fb_free_mem(info); - dev_err(info->dev, "kernel gave me memory at 0x%08lx, which is" + dev_err(info->device, "kernel gave me memory at 0x%08lx, which is" "unusable for the LCDC\n", (unsigned long)par->fbdma); return -ENOMEM; } @@ -486,7 +486,7 @@ static int sh7760fb_probe(struct platform_device *pdev) ret = sh7760fb_alloc_mem(info); if (ret) { - dev_dbg(info->dev, "framebuffer memory allocation failed!\n"); + dev_dbg(info->device, "framebuffer memory allocation failed!\n"); goto out_unmap; } -- 2.41.0