Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9574294ybi; Wed, 24 Jul 2019 06:29:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7VNGYtZ0JSEHl8UK9yefKJJf7mI3FQLK7dhqf/Nxp2hbSWFM6pi8KLdEk8EQKq43UyamO X-Received: by 2002:a17:90a:2247:: with SMTP id c65mr84531094pje.24.1563974946847; Wed, 24 Jul 2019 06:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563974946; cv=none; d=google.com; s=arc-20160816; b=VBjA68sRC9e109sEXQTCytN8HK+PvRWMii8nwdWtoXDh/VQWWIoAkZouPj9F62XHy+ gB3/3vcFnpp59vYv/6DaJlfPXbCCerzJH+tAhLwLEkIhTzO0S+IRYFSnLz4tORwYUfdl cDMfsv6c6YGiaNj10CW3vhUmldGEaJnS68dfKIDbbxi1l2t1vFURvFL34l/bpFXChzjk SNFtSzJh712/jf+I7hpGfqa6DV334YI4Zm261RF4hLuhGOjGghtn9/gA1MjNoucbbAYT fks00m6cB9KqLJE4wUbdX4S9/T7tQ/ID4uwTMTXnosJU4BndsXYalHgSLildXi9aArE0 zkrg== 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=M65x0rcjdQ+L+xMxfa4ktYvbjy7eRRieI4KAgQxJ2Bo=; b=1AfRKeZuv33VWJTN0ppXYIxkUYFsUbM8JrjUGdtPlbXCFiPU2vKSb35pPd3Dr2HHTi EQB7cDRWriy3XocXAyGe87COVGduHtOsLPVz5X7GpN3HLXdeCxLBw6YkvgFi5w61BF4B KbigLMHM4xxCwBJn600mWUFQU5EeBzOS7SCIEpxnA1b8JUvhSSPN+vLcMuih8kNrBADr B2Qohp617reLifBbHeHo1eKoJiRfTcNrK3/qsd0WnsEjjxQTrpbZSEDiP8zKKo+ezJKo tF3/n9VNbnWkhm3ql5UJnf1VHX+Ubhy59JI0BLDtcKnJUiNprUmq5/GuyPP+bCYhmH6g 1hxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=X18Azr3F; 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 cd17si14255317plb.210.2019.07.24.06.28.51; Wed, 24 Jul 2019 06:29:06 -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=X18Azr3F; 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 S1728300AbfGXMX0 (ORCPT + 99 others); Wed, 24 Jul 2019 08:23:26 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36230 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbfGXMXZ (ORCPT ); Wed, 24 Jul 2019 08:23:25 -0400 Received: by mail-pl1-f194.google.com with SMTP id k8so21966033plt.3; Wed, 24 Jul 2019 05:23:25 -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=M65x0rcjdQ+L+xMxfa4ktYvbjy7eRRieI4KAgQxJ2Bo=; b=X18Azr3FSYrvMf2tklpGL/Bg3aJ2xBIQDt9JQUBcx05HLo8w7qR1MvNQW7ReZlsAKO 7yPVxgYH4v7drBG86eJ+4ivpSILcV9ILklLbO9uyrgj+W+A7P+E4SraFN45jQypXqQ3r 8c8Pknc4LR/pN63Mf8cpPp/mTRJ7+mDPsmff0z/VoPsRLoCAEtAGWWLHSC1/SoB22rSi 6rFh7fNYTlMJgr8i8TXdY03W6SKZNCwsjNFg6z4iue5EVVoV/fZxtslILEz83y+Zvc11 07ElYodQKsRsyy32cTQfC48yKMxbfr4OKS1qlBWdhYG/f8jtZOEVBb+fnCg5hQchX9Mm CFoQ== 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=M65x0rcjdQ+L+xMxfa4ktYvbjy7eRRieI4KAgQxJ2Bo=; b=I2paR2PDkD+/gkjPfWsN348ML36rYE/WqrL5Gxn9/njTY+IOmbRaJ6hndEUGHmGOg/ ycdb776Xk1pqnsN0UmeVy/8pHzE3n8Sh9W+DJTFDRWcUXmN+p8Pq1iehIjTz4bVR5Cv+ S8KoIkXP8yW0euy4O0ZeDB7vExkdFcyGJZh6OcA8+x8GZQJPA+n0DFPI+yToyQ1pZCuw aHId3q3mNDaIYCbr9o4ihOzumlhHH7gjiTtwLrIeImwkj+kZgA2Ux91tQye2IavkuQ+o cmriid06KQEu1WjR7PbWfVn2Lq7WI5oTEPl2VJoBcLkiAn3repvfuhYCoSydbjfOatFn cOnw== X-Gm-Message-State: APjAAAWj9GZROS6MaZol2+ObrErnKni9+vvR0MJ05gv7DnhFReIrB0Z2 7EefPWzoH8WAPcB7YM6UhW5xhXfg834= X-Received: by 2002:a17:902:740a:: with SMTP id g10mr85999960pll.82.1563971005247; Wed, 24 Jul 2019 05:23:25 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id u9sm13675245pgc.5.2019.07.24.05.23.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 05:23:24 -0700 (PDT) From: Chuhong Yuan Cc: Srinivas Pandruvada , Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] platform/x86: ISST: Use dev_get_drvdata Date: Wed, 24 Jul 2019 20:23:20 +0800 Message-Id: <20190724122320.21802-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/platform/x86/intel_speed_select_if/isst_if_mmio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c index f7266a115a08..ad8c7c0df4d9 100644 --- a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c +++ b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c @@ -132,11 +132,9 @@ static void isst_if_remove(struct pci_dev *pdev) static int __maybe_unused isst_if_suspend(struct device *device) { - struct pci_dev *pdev = to_pci_dev(device); - struct isst_if_device *punit_dev; + struct isst_if_device *punit_dev = dev_get_drvdata(device); int i; - punit_dev = pci_get_drvdata(pdev); for (i = 0; i < ARRAY_SIZE(punit_dev->range_0); ++i) punit_dev->range_0[i] = readl(punit_dev->punit_mmio + mmio_range[0].beg + 4 * i); @@ -149,11 +147,9 @@ static int __maybe_unused isst_if_suspend(struct device *device) static int __maybe_unused isst_if_resume(struct device *device) { - struct pci_dev *pdev = to_pci_dev(device); - struct isst_if_device *punit_dev; + struct isst_if_device *punit_dev = dev_get_drvdata(device); int i; - punit_dev = pci_get_drvdata(pdev); for (i = 0; i < ARRAY_SIZE(punit_dev->range_0); ++i) writel(punit_dev->range_0[i], punit_dev->punit_mmio + mmio_range[0].beg + 4 * i); -- 2.20.1