Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8983262ybi; Tue, 23 Jul 2019 19:26:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxA1AWjy5lbNSC5q/aaazidfpxDce3SbWg4U3ZFcnTVuOn2OqQAN1aXcMBFWpnoxrq/FML6 X-Received: by 2002:a17:90a:3aed:: with SMTP id b100mr86061090pjc.63.1563935217904; Tue, 23 Jul 2019 19:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563935217; cv=none; d=google.com; s=arc-20160816; b=YbDqcuKlTic8KgVRYycZvzICaSUQhxlQuQcCh8XNpObW+Zxvp8HrKnd3vwOF/u7E0f HrBQJVwY5ZVQJRXS3RzaI3yEIX5dZRJ1UjBkGeHcOFUrmQlCDYJ9aRuLT+HA7MHR+Wib PkWjPlNT9Afe33XtJjXpHhJAv5ovG3zw1fYbGSjHln2rddrHyPrjsVaxWd8dAEKB+FNS YuPxexExiDdPeuTfqAA/DZu+mgoy5I33t5sm8tC7oleTRO+UzZJ4NvcZeriXFkmeUbMl EetC7s8vKy9hmAC0uLCKLbD+7mIVGBalTELXz2tTbuDbMcQV7LES0ag4DCluviV4wDHu Z37A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CN2tNXbOxjbGVP/EEYoEmk5JyHi0LtwAS7W9SVzRNG0=; b=oVrEC9e1IcBgSGt7AYLPmmjJgvaouWWdV9GPqHfQZ/gOvxMzOY7zAZ0CSFikbo946r 8cLQDzEj8IZMRE58omTZAny4pVfZu8/w6nXAwD6kVo1Z37+BtHlaPGPQ1C/13gnVyxnN 1Y2UQOTQEjPYnhqy6UA8ZzxZOADaKvKxXRStS0aMvoSWTKTiwW0ngCPDYiSFHsx0egcb QgL7Txd+uwHS0wqE9ukeUUQylu89iE0VE/1eLlbnVcmTAc+9af9B9lh2ccEaCfLkrUIj 6X420ruP03F+h+d4aMRY6IPQynzxvaIJV7nzxHgyvlmjPXPqdfn2vTAvdxLK74Vd3Wb+ zt3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KAXU6pu0; 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=pass (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 r17si5118945pgo.125.2019.07.23.19.26.42; Tue, 23 Jul 2019 19:26:57 -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=pass header.i=@gmail.com header.s=20161025 header.b=KAXU6pu0; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391564AbfGWSuK (ORCPT + 99 others); Tue, 23 Jul 2019 14:50:10 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51997 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbfGWSuI (ORCPT ); Tue, 23 Jul 2019 14:50:08 -0400 Received: by mail-wm1-f66.google.com with SMTP id 207so39542422wma.1 for ; Tue, 23 Jul 2019 11:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CN2tNXbOxjbGVP/EEYoEmk5JyHi0LtwAS7W9SVzRNG0=; b=KAXU6pu0tAbxDMLV1cJDWvfmDYD8RIG2WS3SfSd5DPuUuu8GNdjCctsnUg1uif5Fyo ZYz30/FBDWDBLLO3QC/qK/PdfZUwzWXdCpslxmR/sefWX9AEws38Qp228HuYG6g5KwPU +jj5uwlD6rLl2yV5JQMVmWjBEtqmrieVliTkLCNp1kgEuqS2ov6VOW03XdOJqrbnSqfR 98eKhk5xrHpzMBs+fNlJllfa1LgL/yz+nDT8Y/0dkC0SBZwtgip2TbGkZ3h0Vivg95ow BZdXTOla2IkdQbzWuMyg1e0Exnjv1RnYJDCGtjND7ZLdExg/mhAoWx560qkZg7ISvStE zxyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CN2tNXbOxjbGVP/EEYoEmk5JyHi0LtwAS7W9SVzRNG0=; b=lt3ABcUxcUmqhspvrPZGXZEZ16lfForGkjQc+HpfAilmNLjjixokjkiH0A3Innyd7A YOMDoGdzAOVjVWjTHvgYtaYScpjcIxURuqF05TjIPHdCQiigSS8G93k/jDnb7TWqN4O1 5OezhWNLEhRUqJC7H/yHbPCGv144Ukjaa6sKEBuwrPX9O2ZOnAFnY0RVTV+klT1gFW/b ZKcW4FwsPO07PsIkPZ+bn0t40WRFzFtG0jj3k8b6ElxQcJ8F0UF0uUs8nyWsnu/HCBLn 2ExpzIJ7sGlN0QykO8C7wwrQMkirNmyT63C7HCu9lZEq8sUYrxqXxHKUCUS0j+3t/a47 aYCg== X-Gm-Message-State: APjAAAWkhoAdvpKXZSXJUtPUW7eyyNZHq89N+jhYTdeKLrVnDlH+eYx9 9ibjyQPkciiFYRNfs0GXhVJrMtGABb4xu3XQs22KDQ== X-Received: by 2002:a1c:67c3:: with SMTP id b186mr66210938wmc.34.1563907807023; Tue, 23 Jul 2019 11:50:07 -0700 (PDT) MIME-Version: 1.0 References: <20190723111008.10955-1-hslester96@gmail.com> In-Reply-To: <20190723111008.10955-1-hslester96@gmail.com> From: Alex Deucher Date: Tue, 23 Jul 2019 14:49:55 -0400 Message-ID: Subject: Re: [PATCH] drm/radeon: Use dev_get_drvdata where possible To: Chuhong Yuan Cc: David Zhou , David Airlie , LKML , amd-gfx list , Maling list - DRI developers , Daniel Vetter , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 9:36 AM Chuhong Yuan wrote: > > Instead of using to_pci_dev + pci_get_drvdata, > use dev_get_drvdata to make code simpler. > > Signed-off-by: Chuhong Yuan Applied. thanks! Alex > --- > 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 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx