Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8683953ybi; Tue, 23 Jul 2019 13:05:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3nKS3xwlaOhTcYdQHospJMlF2ZK9yLBfW0SAdAKwjA0qnztQlXU3OvoJPyqELmZJgRytb X-Received: by 2002:a17:90a:24ac:: with SMTP id i41mr82983357pje.124.1563912321945; Tue, 23 Jul 2019 13:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563912321; cv=none; d=google.com; s=arc-20160816; b=Fup92UVlDBotl0Vf9eZGABtmnDqWqNBxS7szl0dO4be5KW9fb3uq0NHr/VYX4bJMk2 kjXSvuOPPrg4r39gjzMvoifza4uf38QliV1Irk+1QnOTlixumBoFOy+kAvtzgLqeZodd 9JfgN29ethgm+NfMTZopLTKB+AUgme75NndDCsKKLvlUcwT0Zkz7bpj63hQRVMyJ/tDW qB2nsK+HI54qC104lEYRg61WOS4Qi+Jcsa0SwE5XZmqYK/qB0+MjEA2qYG7iXJhplNCl msbqPZfnGWlGHO4p1LKNO9ueVsStxRQxG+2MsUcC3b1hXYGs1Cgq/LX/sXUc69GchuQH GKqQ== 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=hbUuvVU1khp7VKFUFggKwVLkVb4q2fUGBg+CHMkUJd0=; b=loXhWXWGIiws0uaG/9PAK4UspgiYn8iooXYs5N4n8hj3qrxkqJf4giaW8OXkG7i/87 eFNoPdOVqDOWW8AAfxNTB60IpWVQyzLC36hgL+C3u30xmnRGbONB+qFqQqfE4ZWZpQDm R3x7hJllIU5sn5zetvPCO5/7HqJlTSGHHkJ/4z3Mfyvu1iG2kWOiBG2nbRkbh5E/4RM4 SsCCFXmISC2yip2Pi00iWHex0JJO1cPmiE3jD+sLL91RhMppNtGsn1qk2vFBl2ONwH4x PEKuQmmGrak/z38HfzstSa3BzB8yo9l+cGmKGazKTaAFqVnv0AQAiiSYnagH7+Vib3C5 pFZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=l2j4H0Cd; 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 y13si14058124pfp.133.2019.07.23.13.05.05; Tue, 23 Jul 2019 13:05:21 -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=l2j4H0Cd; 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 S2387993AbfGWKLW (ORCPT + 99 others); Tue, 23 Jul 2019 06:11:22 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46926 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732954AbfGWKLW (ORCPT ); Tue, 23 Jul 2019 06:11:22 -0400 Received: by mail-pg1-f195.google.com with SMTP id k189so151425pgk.13 for ; Tue, 23 Jul 2019 03:11: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=hbUuvVU1khp7VKFUFggKwVLkVb4q2fUGBg+CHMkUJd0=; b=l2j4H0CdEmZdpJCZvrzmmDahBvKCJ8fXgy9HbAdqesEQ8sZ1khYFM0LnORwhE0hYZ0 3Ze25ytmIxhjnmXe3bQwRjJ54RsCOGLmVfy40uxaV/DUaqP0KDeJlf9RZD41izLJrZiP gqsxN0rhaGjKtFeWhCWAaiu7Qp4tfMieiTwmdDSW4eP7uzpVH0Fvu7FquuWyi0AqR6ek YHV3VCX2oqZlsxUPmlxxHdyGpoK5fnI+6t/Je1c5LbRl6cw83448Ey1iIOjizX1xb2u9 1UIinCNFpTGduwYlPA3TYct8ABOKHz3JOc2A+IW+tqVEFULDqAXXgDGdoWRSrXKDwJDf QwkQ== 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=hbUuvVU1khp7VKFUFggKwVLkVb4q2fUGBg+CHMkUJd0=; b=Jugl8rsRiOddaeH7vAsWkXSFIj0EIETKH3BjMNoyjy7tgsNDq4V8wY7f7c0H1CiBkC og6MQL5xkt4caqiWfb+73v9RsMkED0ksDVPHHfVE+Sa8IY0so58hJSi26NxgVTCKNCx7 RF0i5mC3cuEAF38Ed1qt1H65ZnQLAibbhp/oyg99Jke7EhaPm3Ney2cC86SSWU4YRvDn acwbj47tF7Wsqhwf4bfhiSG4cX3lg61jDkShDeIDwOJDHG846shE8oGtFJMNZ1xEIuIw ZIo0GCjKieG3rA0Oxi4uQiQwScx/6eOIc6EV7KDyIxrtx0d7CIPRFJjW9ILqxMWmOld7 m0fA== X-Gm-Message-State: APjAAAVMo3C0RkN0i562FqTgfTAMoEgsOWbrXKOoSvbZtZT/SH617+VO yumlVhakSm+RQOQkGthrt5E= X-Received: by 2002:a63:ff66:: with SMTP id s38mr76616987pgk.363.1563876681873; Tue, 23 Jul 2019 03:11:21 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id s12sm43414905pgr.79.2019.07.23.03.11.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:11:21 -0700 (PDT) From: Chuhong Yuan Cc: Gerd Hoffmann , David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] drm/bochs: Use dev_get_drvdata Date: Tue, 23 Jul 2019 18:11:04 +0800 Message-Id: <20190723101103.30250-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/bochs/bochs_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 8f3a5bda9d03..d8a50200408c 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -83,16 +83,14 @@ static struct drm_driver bochs_driver = { #ifdef CONFIG_PM_SLEEP static int bochs_pm_suspend(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 drm_mode_config_helper_suspend(drm_dev); } static int bochs_pm_resume(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 drm_mode_config_helper_resume(drm_dev); } -- 2.20.1