Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8736191ybi; Tue, 23 Jul 2019 14:09:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHHUrs3Jzs6QngquXX85J3zQ5qGUc6kriGeSk8BgMeEb7sEVbqln+lp9CIYiO1/dEJJxzN X-Received: by 2002:a63:c118:: with SMTP id w24mr76102550pgf.347.1563916196849; Tue, 23 Jul 2019 14:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563916196; cv=none; d=google.com; s=arc-20160816; b=vAmRCyJDlxNLs5msUiLWJauEvZOZufpix3snbeGuBvffPMIjUDA6bAd2UiFBPSpFyB UYe5+/66RPgZDheTi/4PJge40oJBwrk3jYyEjB+m7q9fChipXjBzBl+ucGVi+eHEL/Pm rEGTfQJFbcV4qS+YuiKBDYJFop2Un4og1s8W96C9nyjd+NbIPQ4+lvHULi6a2imzFae6 rlzU7IDvczvZbab9iIyHgk5q2sP7l4qsNeEEeM6uHkCk6BXayxUvVyRWlw5oNIl79Rir u/CdhCaHlwc6ZJmUr8J8Fe/hfqEIpXbH6TRtd6CdhTeXRrg7yssZXvRlFn+hWLHjqIns D68Q== 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=TdC2f6TJF86FgwDX6KIDWxr/KpmV360i5Yrw3iyE1iw=; b=OjB4bb5heRXKP2q4rjqos0T5u6VX11fENWFMqag2feGsepJ3x7AfdmkL9CBTfBagSx ZKSA1mQg5QRq42yUV4zSlPXxxVtCPneaqgavAwbsAEyfxAWAkcGB2tw9svS3JKgni6+V KRhWqSOKhFFNnot/ndSrJfu29EgQhFB7K34NPACC9EPhq2oKxYJNsnqhpo748x2/C5i5 gz8j8fOixoFzUJWiBYsGMu/788ylN51VYPNR/xa5F+CnGuxVRQkOSO6Z2wSSNNCGXEz1 yzxXWERzqypyzQSmJQppTeOb9no4R1k6FBBDDQmbB6gr8VP9IE5PiMc3n4FeYfBx0UjW OlOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=q9grusXg; 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 w17si11967924plp.404.2019.07.23.14.09.34; Tue, 23 Jul 2019 14:09:56 -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=q9grusXg; 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 S2389241AbfGWLKi (ORCPT + 99 others); Tue, 23 Jul 2019 07:10:38 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37041 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389218AbfGWLKi (ORCPT ); Tue, 23 Jul 2019 07:10:38 -0400 Received: by mail-pf1-f196.google.com with SMTP id 19so18977847pfa.4 for ; Tue, 23 Jul 2019 04:10:37 -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=TdC2f6TJF86FgwDX6KIDWxr/KpmV360i5Yrw3iyE1iw=; b=q9grusXg7FRhKMtX21/0dcOkdQVBD1QHBhVPY5S/qj/KaUYNuBibLBKhoW+IIIiL1U OSMGVNtBBUIc9Er+gmv9bpB3jOhTSOgpJLdOuVEto1b3OqnjBOXbmrkpsLgPTn3K7Bq6 94ct5pEJZ3o5xlHoXkv2dj838nPe1HBXkI73wObalKvZg8IBkatpdC2blOk8M0Guldw5 cXUrBQBgcq3BjSv46S3m6FFcWcUCzH7ClDC9YaVTYw7i/YlzIaRCp+HWZC2GYEc85pX4 Y5XgjMpDuNKPUX/eGnWcf3sDiUCC1AF7CXfD4oMmUeapfvrDrvUEF5r1pValTcdBfn47 NnfA== 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=TdC2f6TJF86FgwDX6KIDWxr/KpmV360i5Yrw3iyE1iw=; b=E9aRIaPDLTI9+ZDewHSZhsH+mj6Rmvq3MUnGmTMwUWnHlsqXJ3jckO74qqQkFw579t f/zTK3ZRHijXl/OmRaebIgfMZvVNC9cIcw4V1eBF2C5OVm8COcdzTee9m6czIPKstNhA yvs0GvjdFbP4Nb9nJyFubImi6QB/Fx3Uw2pzocLFyQBXCrjAUfJDBfIaPcxNwPAPUyQ9 cpsGAh6vUBf9lA1F//oKe7mgRhXUA4tcfq57fB2JmPd43VrFM55yxEhxdK848l1w00Lw IwgppCUPfNsacIipWDSPNWr37OwuPwCy48siRdQholzWEF5ny4D1pwyB+WML0/YX16G4 r4/Q== X-Gm-Message-State: APjAAAXIU87tO5n0Vli5mSxVgk4WVhaejdJGn3AeqVERdtJe0wQCcee/ K343DN6CRaiAxOCkargqkiLfRek0C1Y= X-Received: by 2002:a17:90a:8591:: with SMTP id m17mr83143286pjn.100.1563880237482; Tue, 23 Jul 2019 04:10:37 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id g4sm54517887pfo.93.2019.07.23.04.10.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 04:10:36 -0700 (PDT) From: Chuhong Yuan Cc: VMware Graphics , Thomas Hellstrom , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] drm/vmwgfx: Use dev_get_drvdata Date: Tue, 23 Jul 2019 19:10:31 +0800 Message-Id: <20190723111031.11012-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/vmwgfx/vmwgfx_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 9506190a0300..8f5f5980c9d8 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1448,8 +1448,7 @@ static int vmw_pm_resume(struct device *kdev) static int vmw_pm_freeze(struct device *kdev) { - struct pci_dev *pdev = to_pci_dev(kdev); - struct drm_device *dev = pci_get_drvdata(pdev); + struct drm_device *dev = dev_get_drvdata(kdev); struct vmw_private *dev_priv = vmw_priv(dev); int ret; @@ -1497,8 +1496,7 @@ static int vmw_pm_freeze(struct device *kdev) static int vmw_pm_restore(struct device *kdev) { - struct pci_dev *pdev = to_pci_dev(kdev); - struct drm_device *dev = pci_get_drvdata(pdev); + struct drm_device *dev = dev_get_drvdata(kdev); struct vmw_private *dev_priv = vmw_priv(dev); int ret; -- 2.20.1