Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9757094ybi; Wed, 24 Jul 2019 09:24:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdgJeupp4bcGgiRXxwirQ3gUG/cSWr1LqsNRua7B4gqEzEENMkx6pNM90hydu77eI3v1gQ X-Received: by 2002:a62:fb18:: with SMTP id x24mr11860874pfm.231.1563985489156; Wed, 24 Jul 2019 09:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563985489; cv=none; d=google.com; s=arc-20160816; b=UdOJunacHQfb7FBbxXUhItJ7wTztJUK+PA7Maa0qYNeQXTAOobxmwJxcQrjJiWmc1q g8/yKqOCbYVVOStXrJKExrrU4kHKI8u0c38s9pkgRo4jNYplZK2zl2P9/H80R9Wtqt2r rkFAe/r+0kF9n5LSlcXFh4yiZW0T/kMMB9ClWWW3/voZ6EkIFF0zGEQYZOoitVr8WnvL cSgBIptRBg7Hw7aWaawUJn7bPH/1gUkn2gel8YxSUfyLUt0/jBatvAp7mnlYuZVLMJ9E SdGdGO07/OcexJcvlyBtXzTX7UJ8I85rpMz9HvIJSI4xRxH/U22s9egxPFMvFPKaVxDJ m5oQ== 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=ynlMYwwbUrHc4SOrISDzcpXFXjwRYIJ/NcSOEUlhS+4=; b=iT5Akj4bPvpMaVtmWtuQCspAr2kk+mk6KzS7qsi8653t95zWJK4Lh5gULn7OLoD06B RtUqUrrh0EizhTPgyb13/sUmMEM/5fwRK81/uWWh/Y8Waki6tDgpOXZxmAe8YYQ+PDzu b6vsdOijdGdEgy7AGK6J36KZ3Vc088L5Gf6hzcLQght/gI4rOIg63ziBIge30IJh06oS ABIC0GTGcHuEIvkVbAGNB12N6wAJl3miUBZcaJgmrqqFAhNGZBARe9LMgS664GLbjoon qKT4vgWVdaZBZ1avyBelvY2jCqAwmHgOeBNnU1KP6qtKiDJsFDM2FjLssODOBAADQTUG B6Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=uolqLFiJ; 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 q85si14798063pfc.85.2019.07.24.09.24.34; Wed, 24 Jul 2019 09:24:49 -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=uolqLFiJ; 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 S1728521AbfGXNRv (ORCPT + 99 others); Wed, 24 Jul 2019 09:17:51 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42632 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727368AbfGXNRv (ORCPT ); Wed, 24 Jul 2019 09:17:51 -0400 Received: by mail-pf1-f193.google.com with SMTP id q10so20944627pff.9; Wed, 24 Jul 2019 06:17:50 -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=ynlMYwwbUrHc4SOrISDzcpXFXjwRYIJ/NcSOEUlhS+4=; b=uolqLFiJouhYH33CRrKgT+//sVZzPIrfc59iUU6EgZhr00v4l0ptOaDu0hPc/o53ar JZj8TTCyFEPxSh4IbMhxTQPCNR9ipqji3s6auZzfK791eBXTBiBs3gguqcYHBBozrHiO W/HqJYp5H/1iQycbJ1Wpy0ZgNnFmvHyspQOT2z8E2W6ViulHCH/ANPwCvlwVuqWzgp1v zDAOQuScR4t07QwfXSmBD4F/lUQexdNp9KWNKzwmbYXIDOhu57YXEtttk1lxL4c/RXq2 NUInL4ZGIogVQqnGOmM6Ly/AxqhqdA0RrNWOdXUgUEE8QKXW5AwBQ7m8tC26h6QogKTy GkTg== 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=ynlMYwwbUrHc4SOrISDzcpXFXjwRYIJ/NcSOEUlhS+4=; b=YUV7a+LqwrHSmLbFTdLVLpyb/1CBJQ9g3JimJWND6YghInlhuBenraz2IOPSSBlRIh t64MNcRB3uYT8/ZKo0e/rp1eX07DSf/Dq9iaTK3nhAQxev4AGRgbOYHdIy4HKTtbbNbS aX8b1LvFjGKXWkUh7McyDlyJpWLmXAM3Hz8ZFVROFZytN7+0ZLMKwKbh64JxwmFdAKCR gSIkmwCuGo/8Pgi73QVyZYCLjSr0mj1Kpi4XCstXBR2tAKQl4W8jmzshvPIUAPo+o4OF iLBshK5QDZSiVWfDFbxaW9ooti0RMDRyOGAaiJnMXxPEpJLQgQNEMtnOIZckbOLXN8Pm j9Pg== X-Gm-Message-State: APjAAAXOrcovfnymutJHIWF6HSd5xJNa0HbT7nIV81D57vSZ36XoUysy uwTd52ViFBCZDxMnPX0siFw= X-Received: by 2002:a63:8a43:: with SMTP id y64mr80625585pgd.104.1563974270480; Wed, 24 Jul 2019 06:17:50 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id 143sm67567613pgc.6.2019.07.24.06.17.47 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 06:17:49 -0700 (PDT) From: Chuhong Yuan Cc: Sudip Mukherjee , Teddy Wang , Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] fbdev: sm712fb: Use dev_get_drvdata Date: Wed, 24 Jul 2019 21:17:44 +0800 Message-Id: <20190724131744.1709-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/video/fbdev/sm712fb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index 7b1b0d8d27a7..207d0add684b 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1694,10 +1694,8 @@ static void smtcfb_pci_remove(struct pci_dev *pdev) static int __maybe_unused smtcfb_pci_suspend(struct device *device) { - struct pci_dev *pdev = to_pci_dev(device); - struct smtcfb_info *sfb; + struct smtcfb_info *sfb = dev_get_drvdata(device); - sfb = pci_get_drvdata(pdev); /* set the hw in sleep mode use external clock and self memory refresh * so that we can turn off internal PLLs later on @@ -1717,10 +1715,8 @@ static int __maybe_unused smtcfb_pci_suspend(struct device *device) static int __maybe_unused smtcfb_pci_resume(struct device *device) { - struct pci_dev *pdev = to_pci_dev(device); - struct smtcfb_info *sfb; + struct smtcfb_info *sfb = dev_get_drvdata(device); - sfb = pci_get_drvdata(pdev); /* reinit hardware */ sm7xx_init_hw(); -- 2.20.1