Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8907420ybi; Tue, 23 Jul 2019 17:50:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUuXKCVRK8Bzg5duC97vClkaBP34bYByE4ggFWQxDu3HsJ/dHWsBmUuZ2xb356yqM4jbq+ X-Received: by 2002:a17:90a:28e4:: with SMTP id f91mr82126658pjd.99.1563929429156; Tue, 23 Jul 2019 17:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563929429; cv=none; d=google.com; s=arc-20160816; b=VdRsS/zxtjeAmUVPHwUMf7LquRCgqdhEANlxZ8q4zz3CJlJAhEOXDPpEWEMYObdeAy Ylkl20kTzFR3S9Q3IBZ+Xdreg8/7c1UHTGNrAEuGJj6s+DoAPRapVePFlvZoGvt9y1il /bpOqsRjLeb462kM9F1Y4rj3WxgHtcN9kc6fq2IaT2l0RBwm8+0XY0TfYBkebxVziv4R mvr9Dqw06cDiHfn6s0UTdsu3m4B99awSS+i3o3bzmKwElAzcstmX90i6nXa22Mo4N2we chk7S3KNXUVFJi1QjivLnv5Qv5kroVZ1f1tSHJ3VLVLfLUtdDURHkKdusLWABnT3Ps/c 0z0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=TAvwkH2SValwZe9C3U6hyTF+Ke1UW7I4gYWRlOB59IU=; b=RKj7va1E8G8Aj4FcYVJWnOgiuej+7A7dz5Dy35x7gVcXQt8iTrBItdXACuaSokRYgn Gb9fC3tsZKXkh8A3c5rmD2LL00bBhzE47eU0PddlGApDIpVK814qHw7g+bwVnp3S/8Eq 1NjAkxmXout0CshFwYkSHQ/wU3ijR12/PZb9B+9KZ4UowBFXoNOOY1pFqzsVZAkbrSCD uKMF4ZC50KwcBkpPneOULIGI6xGl2srTMyCj3snwPcM/mRowMbxhuki94ZhmxosDr0h6 naSgEMUCvpqdLXy6USjbHNxsHAN/zTLMKxUk5bA7tuqvoq2T17x7cgcso0fttS531gls gspA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si11550927pgp.284.2019.07.23.17.50.12; Tue, 23 Jul 2019 17:50:29 -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; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388727AbfGWPkA (ORCPT + 99 others); Tue, 23 Jul 2019 11:40:00 -0400 Received: from mga11.intel.com ([192.55.52.93]:24246 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388432AbfGWPj7 (ORCPT ); Tue, 23 Jul 2019 11:39:59 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2019 08:39:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,299,1559545200"; d="scan'208";a="193104316" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by fmsmga004.fm.intel.com with ESMTP; 23 Jul 2019 08:39:57 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hpwtQ-0004OM-5z; Tue, 23 Jul 2019 18:39:56 +0300 Date: Tue, 23 Jul 2019 18:39:56 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Chuhong Yuan , Linus Walleij , linux-gpio , LKML Subject: Re: [PATCH] gpio: Use dev_get_drvdata Message-ID: <20190723153956.GN9224@smile.fi.intel.com> References: <20190723082933.21134-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) 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 10:34:28AM +0200, Bartosz Golaszewski wrote: > wt., 23 lip 2019 o 10:29 Chuhong Yuan napisaƂ(a): > > > > Instead of using to_pci_dev + pci_get_drvdata, > > use dev_get_drvdata to make code simpler. > > > > Signed-off-by: Chuhong Yuan > > --- > > drivers/gpio/gpio-pch.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c > > index 1d99293096f2..3f3d9a94b709 100644 > > --- a/drivers/gpio/gpio-pch.c > > +++ b/drivers/gpio/gpio-pch.c > > @@ -409,8 +409,7 @@ static int pch_gpio_probe(struct pci_dev *pdev, > > > > static int __maybe_unused pch_gpio_suspend(struct device *dev) > > { > > - struct pci_dev *pdev = to_pci_dev(dev); > > - struct pch_gpio *chip = pci_get_drvdata(pdev); > > + struct pch_gpio *chip = dev_get_drvdata(dev); > > unsigned long flags; > > > > spin_lock_irqsave(&chip->spinlock, flags); > > @@ -422,8 +421,7 @@ static int __maybe_unused pch_gpio_suspend(struct device *dev) > > > > static int __maybe_unused pch_gpio_resume(struct device *dev) > > { > > - struct pci_dev *pdev = to_pci_dev(dev); > > - struct pch_gpio *chip = pci_get_drvdata(pdev); > > + struct pch_gpio *chip = dev_get_drvdata(dev); > > unsigned long flags; > > > > spin_lock_irqsave(&chip->spinlock, flags); > > -- > > 2.20.1 > > > > The subject line should start with gpio: pch: ... I can change it when apply to gpio-intel tree. -- With Best Regards, Andy Shevchenko