Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3186614rdb; Tue, 6 Feb 2024 09:29:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsriLxLk1aE4K2eoaTlWobBHuO3bXlAFefjHBI3+7g2W21OSJD8Ra+9EiHzOBLPvQt+Ljs X-Received: by 2002:a05:6512:14b:b0:511:3ed7:ca7c with SMTP id m11-20020a056512014b00b005113ed7ca7cmr2365836lfo.65.1707240579546; Tue, 06 Feb 2024 09:29:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707240579; cv=pass; d=google.com; s=arc-20160816; b=azgRdlLUzvKkHxs/e43iQQYroGH9oJ53Hv+M/dwZjzR0+YMZEUu7XeKePd9BTwS4Aq P9ZnzGZYN13hIWBXUGpp4NDUEqzsqZkIo0InaSWRj3rjObz7hF3rX01GsYgCFZx+Ync9 1b8kqub8XLEJS30pxjJdRyTlHrgwWsyW5slhUgAT0Db0GlF6dkQp9GCvMj/6ydVT4EVi qMgcoZ1d0khCI87erjDEaAg5Q9oyUXdYovq82j6mm+cppVQs0phZqsCHk3khyQ89/ky7 7WrKa1su05kqhq1sSl/fCpvopuZvJ4T7U6dRqvQ28nRKkpnpai5zzzliOq0Nh3p900Px pYfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=y0hdY76agQrzY+9gtVZaFHqY84LfFC9/R41cfmLOlh8=; fh=551597Bzf+Bnt28Q2v1DfmX9NW0A1U1fe0ku6ep/e38=; b=EU7NlFsn5cfv2AAOGgkxGvJtzPJgUqhge0IJB1wyRaeYBxeESyymJiDK7DAWsYViJq Jd49AEggDWBcXnlO1gE52GuMIqMKIUZqhW26Bmm6MIeMoWyIc53G8AN2boZO2tI1mdPP 96oaKHD21Gt5CqPXXFkD0EjvNffis2cZ0hhojorz7CS9LuHkmEWiHpMQGZ0n57/h4gpW 3MVIBE06iDCfu6vK4T0nF8MJETcxQlPrlB6nwR0Lmg9Us6dRg6RuCLj6i/lj2Gx1gQ0p PeZSb0BtUUa7hr7pYcLHE3BPkcTHGd10gWBGj56WfoBb7w8L6cf08cBY7n9vdEFWqkgD OecA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=dvCnJRTV; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-55376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCW5I+CU9iVf/YZeXTpjfZPyw5rIe9IkHC244jCyHKB99fif1hDNPJYf2SXymkREWyThJiduJDSPmzZRHibG1qix1KjMm4S3uveMIoDDqg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v5-20020a056402184500b00560853f6bbasi1366010edy.592.2024.02.06.09.29.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 09:29:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=dvCnJRTV; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-55376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 49DF41F26BBC for ; Tue, 6 Feb 2024 17:29:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DF581426E; Tue, 6 Feb 2024 17:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="dvCnJRTV" Received: from out-184.mta1.migadu.com (out-184.mta1.migadu.com [95.215.58.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76DDA13FE7 for ; Tue, 6 Feb 2024 17:28:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707240515; cv=none; b=FiIn7dRV/xZ8zlj8A5JGDkzg1etEb3UvQ1CqT8hnULulGlomeRT8fK8U9hQcpG+U2g85vfMuTSi0k9+MeiaSu4cqgQ4HZCSo3g+wx/apcmsS/FC1eZWvaJlplwXai/U+hLnKd0OFuF+cwrw3+4ydnz8vXRRaK6xGf9bl2hO6nqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707240515; c=relaxed/simple; bh=03yi27ExKzCdAz4CD/WXAaSXy3Go2ef741YE4yG2Vcg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kZqT+1iFOZz+6KJDAdSqpLS3ZnLh0Aw9ItTx1SbM1zE6XIP2UbjhW5Lj6ko+JBbOp73ZB0t5iokzwduhTk1kMAF343hXX7Q5pYKsmGSI/UowbMTDEYX7pzdfVlorNUTSkezlIfJWy0tl51b8tyur/5+HQQFgEgQosSpWE2XTD38= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=dvCnJRTV; arc=none smtp.client-ip=95.215.58.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707240511; h=from:from:reply-to:subject:subject: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=y0hdY76agQrzY+9gtVZaFHqY84LfFC9/R41cfmLOlh8=; b=dvCnJRTVEODFXuwOO7YyVPHVEEu1sDKKoH+z9Dc8yc7y0A+nMKTi+8arxlg+5p3Lnj+S29 GpgdG3j7ZriNqqmz6xWa9RjvifOP2uLBlme0lZNYhINy9OcR/9VEfG2JrBHLxqt2u5taEb tXE6/8DzvG4NxsC3XmeerKEgsM0Y5ZU= From: Sui Jingfeng To: Lucas Stach Cc: Russell King , Christian Gmeiner , David Airlie , Daniel Vetter , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: [etnaviv-next v13 5/7] drm/etnaviv: Replace the '&pdev->dev' with 'dev' Date: Wed, 7 Feb 2024 01:27:57 +0800 Message-Id: <20240206172759.421737-6-sui.jingfeng@linux.dev> In-Reply-To: <20240206172759.421737-1-sui.jingfeng@linux.dev> References: <20240206172759.421737-1-sui.jingfeng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT In the etnaviv_pdev_probe() and the etnaviv_gpu_platform_probe() function, the value of '&pdev->dev' has been cached to a local auto variable (which is named as 'dev'), but part of caller functions use 'dev' as argument, but the rest use '&pdev->dev'. To keep it consistent, use 'dev' uniformly. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 10 +++++----- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index e3a05b8b9330..d5a5fcc30341 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -612,7 +612,7 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) if (!of_device_is_available(core_node)) continue; - drm_of_component_match_add(&pdev->dev, &match, + drm_of_component_match_add(dev, &match, component_compare_of, core_node); } } else { @@ -635,9 +635,9 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) * bit to make sure we are allocating the command buffers and * TLBs in the lower 4 GiB address space. */ - if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(40)) || - dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32))) { - dev_dbg(&pdev->dev, "No suitable DMA available\n"); + if (dma_set_mask(dev, DMA_BIT_MASK(40)) || + dma_set_coherent_mask(dev, DMA_BIT_MASK(32))) { + dev_dbg(dev, "No suitable DMA available\n"); return -ENODEV; } @@ -648,7 +648,7 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) */ first_node = etnaviv_of_first_available_node(); if (first_node) { - of_dma_configure(&pdev->dev, first_node, true); + of_dma_configure(dev, first_node, true); of_node_put(first_node); } diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 306973660653..3fd637c17797 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1903,7 +1903,7 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev) if (!gpu) return -ENOMEM; - gpu->dev = &pdev->dev; + gpu->dev = dev; mutex_init(&gpu->lock); mutex_init(&gpu->sched_lock); @@ -1917,8 +1917,8 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev) if (gpu->irq < 0) return gpu->irq; - err = devm_request_irq(&pdev->dev, gpu->irq, irq_handler, 0, - dev_name(gpu->dev), gpu); + err = devm_request_irq(dev, gpu->irq, irq_handler, 0, + dev_name(dev), gpu); if (err) { dev_err(dev, "failed to request IRQ%u: %d\n", gpu->irq, err); return err; @@ -1937,13 +1937,13 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev) * autosuspend delay is rather arbitary: no measurements have * yet been performed to determine an appropriate value. */ - pm_runtime_use_autosuspend(gpu->dev); - pm_runtime_set_autosuspend_delay(gpu->dev, 200); - pm_runtime_enable(gpu->dev); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_autosuspend_delay(dev, 200); + pm_runtime_enable(dev); - err = component_add(&pdev->dev, &gpu_ops); + err = component_add(dev, &gpu_ops); if (err < 0) { - dev_err(&pdev->dev, "failed to register component: %d\n", err); + dev_err(dev, "failed to register component: %d\n", err); return err; } -- 2.34.1