Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8749158ybi; Tue, 23 Jul 2019 14:26:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrhFhZm7CbuGha6RTfJlCbkiuqfcgFdMgHt4hvBrwq0NFuh2wOhbfT0asC3ph4TK2LbiWd X-Received: by 2002:a17:902:7c05:: with SMTP id x5mr83121113pll.321.1563917183936; Tue, 23 Jul 2019 14:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563917183; cv=none; d=google.com; s=arc-20160816; b=DMDs2ZTmOTKCtqdf5213Quwf3yPPKd39gXQSQXKUPTEG4HK+FHuI/H2RDdNS8L7r52 8Tjzp9UxqQw8DM9RGwj+r2JVSmokAKxJgLFjYJyPMBYK9d/9uXf0pie0xLlhgfTYTjg3 CgUN+Pz5iEZ30yJg45z3DWbj8bcWXsvQkjs2wFOJ9lgxz/wZdrdSJy6E02qqsUC0j9fu oMLvb/6QoStHA5QtWfbZ2N2NZzbJYdzvGYzqGRdPxufvA51JlDDx4j/mkfglhbDJOEiU 9SxaoAxZFO5RK0RSCie0Yzk19mfF6fp0vIpzsdkqF7d/C1bbxkbzNjTboDm16s6Oez15 bm3A== 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=LxPuevqDrXKRl+QxbN2Y5oAWPx3TYkvtTDFzWJOHnjs=; b=mUawT9IMwkHDrSTeMAjyuEP/jU5lrbQ0SPWVAVq2IHy8VKkeCcjnOd8G108WX6JZuA +gb8Cze6FL77UPlmSrA/nwEQCa6TcjBRUYM+iiYNXLV6wVs1+d0OmYjFGItMEz/iaRIg 3vVpUoRXOIZ/CqxTOF4iN8wcSZpijsqmmNhcVdjFZo8nm6MNHG8i1X4gSGhyiGyweim3 kcRN5FLhJPyFfUeryS+LpzfJqmY9FQS9drr912BOlasQ5d7yYdASkclCzlQ+Ow7kZNPZ rYdvjJy2WrNT9btX56Lrrq1EkF6+qluwgRsuQKbCJMlL8JijpuBQAVckSFeL2rRbqcP8 dJDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YG9fniY0; 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 g127si3347463pgc.128.2019.07.23.14.26.07; Tue, 23 Jul 2019 14:26:23 -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=YG9fniY0; 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 S2389194AbfGWLKS (ORCPT + 99 others); Tue, 23 Jul 2019 07:10:18 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40087 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729769AbfGWLKR (ORCPT ); Tue, 23 Jul 2019 07:10:17 -0400 Received: by mail-pf1-f194.google.com with SMTP id p184so18968555pfp.7 for ; Tue, 23 Jul 2019 04:10:17 -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=LxPuevqDrXKRl+QxbN2Y5oAWPx3TYkvtTDFzWJOHnjs=; b=YG9fniY0/+oHh3gEX8AcUgyWwxPgWQEPEhxjpZHpi94MqnZXwH+QdVyrVg+nmhEA8z SM/UqyK6EtA4Bc5sa2cLFgokwYU2cT+2CdpDqH76HU2xSy0bx+tFcd89YVxyXRuE2vLg MKlCtrYeWocOOwxzyIUrEwiYK2V+ct1EWD4rtV4vHOajVWE7zAA514xDwLU4s+36/CXp oWHrs4WW3S/NtRJrA+HaLlsocF2CgILAkg5SO1ue14LiWHwap7WudPDhryPG1+wpEr77 RqA8g/5FuGum/BQHeLKg5v0+rVdCadygiLFXiEjpIN9sOreBsWuYIzbOT9LR7H+lf6Dh jBnQ== 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=LxPuevqDrXKRl+QxbN2Y5oAWPx3TYkvtTDFzWJOHnjs=; b=kXJZV1RtRgzWiyDr1wABIHZFiCTAJA/3pE1SAtyEZ4ZiHXauawIFU2+sZubmd15e9P Kbomet9/dRCtQbQUOmRWEKJhdtsGhHbhWzyx8XjrPicnYxuycF0bTcZFrQ75P+Svz3hf N/xd9uLVCyMnk3HKLOOFWykJGCzcbry0JAJiCFEwlOZKmQ3f6EK/pHgGsvU1jfE6Yf5+ UlvxEKYBHNvBtBvoiWeEZTWzggGhObPfneTjW5fuqQXsDfhslmhy6bb/FcEhd/63ZM+E Et011OdAXyDIDhv2efGuyYnzFFNcisbr2NgvqgTxEieVpyJYtpYPrnC4YFXG+8W8WuXe 4e2A== X-Gm-Message-State: APjAAAV7qLengKLwaMFReRfhPQmrZr1+x2YkL5oSxBOSOB1Y8mWbOvns vxmCYxHl++V5J/EkkO9iAFk= X-Received: by 2002:a17:90a:3590:: with SMTP id r16mr82708219pjb.44.1563880217039; Tue, 23 Jul 2019 04:10:17 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id v126sm11374576pgb.23.2019.07.23.04.10.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 04:10:16 -0700 (PDT) From: Chuhong Yuan Cc: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Zhou , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] drm/radeon: Use dev_get_drvdata where possible Date: Tue, 23 Jul 2019 19:10:08 +0800 Message-Id: <20190723111008.10955-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/radeon/radeon_drv.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index a6cbe11f79c6..b2bb74d5bffb 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -358,15 +358,13 @@ radeon_pci_shutdown(struct pci_dev *pdev) static int radeon_pmops_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 radeon_suspend_kms(drm_dev, true, true, false); } static int radeon_pmops_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); /* GPU comes up enabled by the bios on resume */ if (radeon_is_px(drm_dev)) { @@ -380,15 +378,13 @@ static int radeon_pmops_resume(struct device *dev) static int radeon_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 radeon_suspend_kms(drm_dev, false, true, true); } static int radeon_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 radeon_resume_kms(drm_dev, false, true); } @@ -447,8 +443,7 @@ static int radeon_pmops_runtime_resume(struct device *dev) static int radeon_pmops_runtime_idle(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); struct drm_crtc *crtc; if (!radeon_is_px(drm_dev)) { -- 2.20.1