Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11175410ybi; Thu, 25 Jul 2019 11:16:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3f+/OiDGE5MC1Fq7YdeHJZsMFQSRq293Nh3JGvt+QsmXBpvqtHVCAsCeeWWEQNnODtq5+ X-Received: by 2002:a62:3c3:: with SMTP id 186mr17939225pfd.21.1564078603920; Thu, 25 Jul 2019 11:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564078603; cv=none; d=google.com; s=arc-20160816; b=Te+E1U1wzoNsbGd4fhrhap6MODlU670qRySsDz5PhpRGQ3nJpDnM9S/Gj05jaY6P2+ pOsGc293u3QKUecB1syX/hSGhzIZUqY2YtW8Ix6CfzWfcDtVsIPIEkgRIhNaS9nbWZAs JTAdWwY1lgZ2XbdfBMrfOk4j9ewitBHKrhHfJuLEcSY4SyP0c/TBwQTWpHnqV9CXYEVo 96iJW9UhUFoAJFQoJAiovePYfIpty9xFy2p/Az0ikmrapkIVQRn9gaERuu8KvnUWRW/h k5JvhrXEZaIRdFSKcvp1ti85IPO41s2TCFyUgTuWokhEwGk9P7lEX81/NdKwMMcn2jzf PsNA== 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=SDQdIEC5lAFm3yeqFyVPcDyvNShQJnmklTsND46m4Mo=; b=vsfo/Fglke2R6zUyOO/FeIHTsOeBWCEcypcwCsb3LaFchVVfLafGdZfQcbObpWYUbM AhA36scCxB1XSfQ/71lkods7aPALsWV03tbm4lgJfILq0LwybZxF5MK1dOdR/ngAFQfF tdPBpiwqe3YtaD5zR16a3oIJ/hfsAoo3pMla9GAkve83fzg2JV7unMK0CbMO/qenRXEC azwtQQE1+34IeFKumRqvGsrNJh3Qd9o7ipHmwrCZhLfelJ50hroMcs2osjspnuqSJiyV P2SGsAhb5t3V7d3dtTAnhuxpmBeuhDp9gOZRfCyXael5/hkrf2Eq4lXEeAp9oyqJDIpy IwdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hJjvEy0r; 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 cd16si16132800plb.72.2019.07.25.11.16.28; Thu, 25 Jul 2019 11:16:43 -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=hJjvEy0r; 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 S1728251AbfGYSA3 (ORCPT + 99 others); Thu, 25 Jul 2019 14:00:29 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33432 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726470AbfGYSA2 (ORCPT ); Thu, 25 Jul 2019 14:00:28 -0400 Received: by mail-pg1-f196.google.com with SMTP id f20so14181848pgj.0; Thu, 25 Jul 2019 11:00:28 -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=SDQdIEC5lAFm3yeqFyVPcDyvNShQJnmklTsND46m4Mo=; b=hJjvEy0roGRFSuhkDSXa/ul/k1i0vNdVeJloGKhDdynILhOpibQ51mNlZHU/SJ1JR3 0PcEowfre3uztlefZfVYS2ddRqrM9qMM+xvkSCqZO9XVHeV4rB8gQOhPHIBt6+BdFJbt B+TFOJuM4cgtgTQWQH8jIVrpCdsBHshclNNG4yXPpSgp/y82EDNBIGaqg7h8/JXBgEAe vhj289uwT9t/W+suUpGkj3mvgIORKJPHoIwu/SniqyuunXAkzj8Y7x7/9Yos3XhN/s0V fNpoZLDl5ZwPpOAGaRq+wcYXqnk6FKoptZkgoInhDJIiDExYRG6CLjebPFJW5RBkEBT/ s8MA== 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=SDQdIEC5lAFm3yeqFyVPcDyvNShQJnmklTsND46m4Mo=; b=qseCXFYo7z4P2rJUtCndWrSKC1aRsiOv9ti9uiJbQjEgvrcYehXuCjEIBUoQ3wqTV2 sk3wAaM3eeSV1qRAl6JEfVDtALJouE6bZ18hz5tzeY0nraMdYLBIJLGFjWsDIda4bZkJ AKX3zvSpzGnmooNx3WI5f1iQ5DNklUYcJH5LFhKlPebNollPG8lPCHMVQpbrsMazGu19 Bi5JDs1yqFwmoq+1CgP4KN1d7/zUCV+Db1LQiuIUXuAd2VOWEWWtpG3v4zO9arT2y6ei diMTqbXdIDr7p6hT6B/oRVDjO4ajx5Zvb8iwORs4vs/tRF9yrAUXv3UQtCkPLMFmXp1F zb4Q== X-Gm-Message-State: APjAAAX2/QlDJVxswMivW1UqhuGquHE0qOKn2Pg7kibUSS4jBdgB41dn KdnFbba1IwWwdONt+6ubXqxpLrOmEYYIxk2ZOGg= X-Received: by 2002:a63:6eca:: with SMTP id j193mr12231277pgc.74.1564077627929; Thu, 25 Jul 2019 11:00:27 -0700 (PDT) MIME-Version: 1.0 References: <20190724122320.21802-1-hslester96@gmail.com> In-Reply-To: <20190724122320.21802-1-hslester96@gmail.com> From: Andy Shevchenko Date: Thu, 25 Jul 2019 21:00:16 +0300 Message-ID: Subject: Re: [PATCH] platform/x86: ISST: Use dev_get_drvdata To: Chuhong Yuan Cc: Srinivas Pandruvada , Darren Hart , Andy Shevchenko , Platform Driver , Linux Kernel Mailing List 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 Wed, Jul 24, 2019 at 3:23 PM Chuhong Yuan wrote: > > Instead of using to_pci_dev + pci_get_drvdata, > use dev_get_drvdata to make code simpler. > Pushed to my review and testing queue, thanks! > 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 > -- With Best Regards, Andy Shevchenko