Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8685349ybi; Tue, 23 Jul 2019 13:06:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyh1ZMGxDOpWroSYAy5dD+7X3VUwWshv0LJSNcMZb+/CBsu9K+XaxABZbAHCSYpLowSJaEa X-Received: by 2002:a62:7695:: with SMTP id r143mr7749009pfc.173.1563912405337; Tue, 23 Jul 2019 13:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563912405; cv=none; d=google.com; s=arc-20160816; b=Dnu5ljOQpTuha018YbY+5nP3sVJMbsXyaQTsvzoMoQ5fA+ORT7SPzx0V+bebUctJyT Y2rFe2xp8AefGmR8zKkp1ckzxgX9Ikz+iG2FOFVJM5thDbQjpnlsGHnVQRTWMyKyFf+l HFrwl0YYwR2duAEcD5zAhEy/78jxFdAEKVfm8MH3ftY6PN0wrcVZv/nNxX3n9h3nazrG 5peLTLqzC8zUw14L9gG3wnk3wV/i2u18jags70zqxzN/3F+yflViRgDfLlDSAAbQeHJd PfqY3/Xrqme2/FeUREVBz8AIPVUuQ0o4oTGwh7FWfRwotIelgNTMOoOTniGMJQgo+Pg7 tOhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=Di0g6EEgkUa8jtL/xEkGliBvl02Xk0g05krGCQwF+C0=; b=V9bsyDa5X8ZFimwlcpJCBn38DR44u4zWdnWfHEH4u09go1dFbCYZx7qUGmJ+C6cYjJ 4YgJ3EEBZvMumdfR9gGUKjGT/f89VnAubscFzHHmPRC3qEsPdoA9qkkCNK4DEh2LxvHg Z1LEpX+5YcsprQIftsdUrpdkx81SOZ01rWtlKuy9LKlXhwO7yjit3+dXfvUBa+Og/Waz cp258M1p4WPL2VAv0ULcFJQvxcfDATLggrAWcMcDJBLJBi7IUDHDrtmre5n1qK2UmtHp w/e4St99lYcGsJ6Ld34YtJDiVyNwv3e099HAPY9qCzniYeifR9JfQ2DrA20wRFaER9bh jpaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FwOqdcTP; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si11952774pfo.234.2019.07.23.13.06.30; Tue, 23 Jul 2019 13:06:45 -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=fail header.i=@gmail.com header.s=20161025 header.b=FwOqdcTP; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389157AbfGWKj6 (ORCPT + 99 others); Tue, 23 Jul 2019 06:39:58 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35662 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726920AbfGWKj6 (ORCPT ); Tue, 23 Jul 2019 06:39:58 -0400 Received: by mail-pf1-f193.google.com with SMTP id u14so18955420pfn.2 for ; Tue, 23 Jul 2019 03:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Di0g6EEgkUa8jtL/xEkGliBvl02Xk0g05krGCQwF+C0=; b=FwOqdcTPuWHslyIqWCg0jHZvRxaESjUl1kVvzINTDBMD1Pz/t53rxJBG58X7IdmmWL sGPB4oaAXM8veLfN8/TaJNN+KxLHZkIOAR5uX4uMCbJ9LDlpub0BP6KTl6wxxfmqcUe/ 0LJHP+CtHakkxv+3kGR0t0gqiArmXgtJezB9n6LryYiAW8ZKDk38hbqSOMgZyZwZN2H4 G9QmrsvgHnufM9U8QHoa7FWJCypNLOPhGtDJRp3efrzHoDH+otqKwqbdKcrmXHv+768T KGU9mla+HYsr2XwDu2bMhs4PCzy876fa0Ik209o4naJVpmHOklGN6E9wmwEgjEHWLpX+ KWTw== 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:mime-version :content-transfer-encoding; bh=Di0g6EEgkUa8jtL/xEkGliBvl02Xk0g05krGCQwF+C0=; b=OvXpFo3SZ28+8i8LBapA3N8jIRJsEMUoQ5vVmqextRkCeLVQx8FQdcLYBeub6Yh8Kw bX38Y1M8CBtRorYFzOR5MWgH+eb2TrVfkxSOZIu/47gVmWgPdViEYIlBJ0slFsPvyMIB 9zmnIVY5y6Xo27K38+gmzafyGcYMW7aTjM4ImfA/NAlPT0zOCIyL44pLeZU2tOfPFOAl M6LUhJCDHyRk/mqztRc8/gVrTYtsVVFVz2Os+GL2fG7yB3/1pGz2rQyJbgWkXehotxRr JVid3xVb2ixM3R1REhAHe0CFenqbjeO7uddO/clTgpfAZE1Fl5HI22aSPXOl4a569gee o1bQ== X-Gm-Message-State: APjAAAVNIKGsGqZbKdBOjXIOW3k5MH0HXaAjZPD+0paycrFb3LYdWp/T vUqlHbgUZ4Sklt+IaiuQaBU= X-Received: by 2002:a63:20d:: with SMTP id 13mr64729846pgc.253.1563878397922; Tue, 23 Jul 2019 03:39:57 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id x9sm20574868pgp.75.2019.07.23.03.39.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:39:57 -0700 (PDT) From: Chuhong Yuan Cc: Ben Skeggs , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] drm/nouveau: Use dev_get_drvdata where possible Date: Tue, 23 Jul 2019 18:39:39 +0800 Message-Id: <20190723103938.4021-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/nouveau/nouveau_drm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 7c2fcaba42d6..23203dae2137 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -883,16 +883,14 @@ nouveau_pmops_resume(struct device *dev) static int nouveau_pmops_freeze(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct drm_device *drm_dev = pci_get_drvdata(pdev); + struct drm_device *drm_dev = dev_get_drvdata(dev); return nouveau_do_suspend(drm_dev, false); } static int nouveau_pmops_thaw(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct drm_device *drm_dev = pci_get_drvdata(pdev); + struct drm_device *drm_dev = dev_get_drvdata(dev); return nouveau_do_resume(drm_dev, false); } -- 2.20.1