Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8701646ybi; Tue, 23 Jul 2019 13:26:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5Jtj8UOZ92ASOiKnz8xvGm93p07X4JpX1qhcO0EbR5E/cnMnVZ4O4/jc+07SJk4z6N29V X-Received: by 2002:aa7:915a:: with SMTP id 26mr7545244pfi.247.1563913589936; Tue, 23 Jul 2019 13:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563913589; cv=none; d=google.com; s=arc-20160816; b=xQfQmOHKXVdCMnpGG+tmoi661M0Uwjmb/Uvh35ivTUcmykK2WJ5u3oLb8RF5j/2rFk 2sg4zoIh9z63/zhkySOEjx0mohXXlLLm+aCgqZTlea9YbluFeQWGYnQEgLIdgjXtjO/N I2qLrbaFB+yHSh6xn2wSlnOHFEQzAI8RFMHBXo4RatPxAOkhgZtZhBzceU1/AGBaFYAa ai3m1pbpT4QnGXQogCkuSM0iS0aC3bGLlFGbaAgjGgRrebm1Ou7MOBZBE+tFW7nTo72F nrCCfM0FFeFnLledhSnBH1rI+RHvGm2HDIu/sawLD37JeqGmrj7waXSe+Film+iVZ7g+ QSKw== 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=PK0IBZUbQHnyOZDtUqj2prrcS6SHRWpLkmBXJgDEKWo=; b=yxoH5NQ8AL4KCJ0Ppj1t0/bW7nF2nSkMSaRinfxUnChCohyxvkmuaK04P+szRipIbB x0JuuhSvS0H0qnq7nhrye9zdLCA8sMiCv1mDGMu3qLv251TOA4Tau1evKznbiLG257xI nV/iHDHaysNRo1hosizT8smX+2OjkeXwFUrABPpBzQNoY+wWLSxVu9E+yeAyCWk4CjjL DOM5N8ziaL7tggH2l+BUVYLTgQhlucXFr+RzwwTx5PstJ6PFjvqZ1Jgf51BZPIRL3ctm CH6YUbvkiqvo3NfAU799VcVHaSM37AJCN0cRG4zs1q1Frg8AaNFXBtK+qOfgnDYfrEZH oJZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JJEGgQaU; 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 x139si12525171pgx.251.2019.07.23.13.26.14; Tue, 23 Jul 2019 13:26:29 -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=JJEGgQaU; 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 S2389163AbfGWKkX (ORCPT + 99 others); Tue, 23 Jul 2019 06:40:23 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34798 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727381AbfGWKkX (ORCPT ); Tue, 23 Jul 2019 06:40:23 -0400 Received: by mail-pg1-f193.google.com with SMTP id n9so13006787pgc.1 for ; Tue, 23 Jul 2019 03:40:22 -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=PK0IBZUbQHnyOZDtUqj2prrcS6SHRWpLkmBXJgDEKWo=; b=JJEGgQaULMIyBtsF9Zmew5QKL6iwU5DJsa+yzl56UpjBCSjzgnjbTm1D8sUg4zA1fo Rqvm5clXYIpVWuG3UvJ9Guhup1h3dWDqi38rpeBx/FQY9fMC+0kHJ/8HCq7soKQOzCxx nwgn3YjizCPCQ+Qi1XLpVkmwNITnKWINbFnzbGrSoayK4iQeWX6AjULlyQGLwmHCQtVV amlHgx7MOvg5GCeXx3OWz4VxnjAET5qyqL22PCCiUT9Jg/TO7ESxfPptPJhKRwX6ycIF GmOZ/RysLc2ZGHYfZv3DeeT+V/3DXyPwVvAGE2FKJKioGkfe9H/X7N7azeOk2u9XISBs q4Kg== 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=PK0IBZUbQHnyOZDtUqj2prrcS6SHRWpLkmBXJgDEKWo=; b=ZapIzNnsPz5hp+GYwcM4AYwCJ6wehrpANu3ClVIp9lDxydOC5IKHBGUmEOYIerc+QM d2XvEVhJWh1RdynS8Nu8uBrC06S07VAenmuwqc9OPDKNZuOTaBbgMvaTQNN7Nb0UCLgU mtGPb6TA6X3wvKtwVHvvkpgHfpaZ5Zu+3pulZ759pxLX/io0b2zSL6pJXqbRsNqcp6J4 r0DcVXcvzSjqXOuWCXflka5DLNkygT9gMiS1bgGLJhDbikfi8+Bv8IU2zXiEBQ4sbqpu W2uGBicRWobYc+EwqBraNxKtvFjQcjVOel8MZR96LWb0V3x7cd5YFigIvoDNlWTs92Lf 6Mtg== X-Gm-Message-State: APjAAAWVCLR6PmX4G+dycdrQyAa4XvCT71+duzhXtxlzQTSZyLoVd6rf 5XgRGJEOQBbKTnMCy1DDn18= X-Received: by 2002:a17:90a:1a45:: with SMTP id 5mr83413685pjl.43.1563878422662; Tue, 23 Jul 2019 03:40:22 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id c8sm47990214pjq.2.2019.07.23.03.40.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:40:22 -0700 (PDT) From: Chuhong Yuan Cc: Dave Airlie , Gerd Hoffmann , David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] drm/qxl: Use dev_get_drvdata where possible Date: Tue, 23 Jul 2019 18:40:00 +0800 Message-Id: <20190723103959.4078-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/qxl/qxl_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index f33e349c4ec5..af1e2b377945 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -206,16 +206,14 @@ static int qxl_pm_resume(struct device *dev) static int qxl_pm_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 qxl_drm_resume(drm_dev, true); } static int qxl_pm_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 qxl_drm_freeze(drm_dev); } -- 2.20.1