Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8920382ybi; Tue, 23 Jul 2019 18:06:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1l41jzwZykTAaVG2TlKajyEaMdc4UQo73Znsy77EKMAnDqCVnhbJa6x/hfUtkxik3lVOt X-Received: by 2002:a63:d30f:: with SMTP id b15mr78188987pgg.341.1563930382042; Tue, 23 Jul 2019 18:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563930382; cv=none; d=google.com; s=arc-20160816; b=EZUWWjPl0K4rpYlH/+TmxY7ocwskvVm2dj6FW//akoNdoexzJIDxjjKpjo4x2Z/EIX J9Fqv9eZwIhUcPBum0REIHD6xGhoYpxfHb7NGY3bZGrtRNXd1b3JSAFrRY2PrOFKBPDC KJT36aXx5cXRhx/LOU6jsIe98Qtim0OG3vbCWaUx8VvTqweuZxe2i4MqK15+QjdjeQ1K etdOOlnJay4IIkiwQbVUA3s6FqcaZpKN2zOS8QP6VdakeonShz4LhwsMF9BJtTzJSIPu LlUHnMpw8fvXEWhsuL4Et+WkXFOMTTARfhlrm65mlrjuVuRe5rKFBn2/Dx1qE/kTUYMj JbJQ== 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=NWlJ+gXlDXeVgk3ZWHEfTMomNG7t3VoOQN43jogjAg0=; b=qoPUmd7vhtmm2EsvsLl6iYdydJYNWzdyzlAXjC1UhaSmHu3jKHp8Oe9suZrCHVlW9c l1D6dDcPWfOXvhj4UOWOIm5LmzzyuWz3IF1wK09TaX8+3RWFJvkFScasMPPZCQAaVi25 VBiCUHPywoU8SWVEcPyHrlk++I4R3pyvOLjdhOKlEZMbOOnY+BA2+iaY3j4WOJxL50FB 1j3gTgAwAsgHuJH5xLW4eMsj+Oe8gN3gHqshCJk3wteKEux7J/2wkOOgOYfH4zn/zaY4 Ji61cb/uI97oCxiFwB0djx713hgBRyuYwn0wmgyb7pxp+W93kj+eb2qNEGmTn+WVEBlm HAiQ== 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 s38si13957601pgl.138.2019.07.23.18.06.06; Tue, 23 Jul 2019 18:06:22 -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 S2388675AbfGWP7t (ORCPT + 99 others); Tue, 23 Jul 2019 11:59:49 -0400 Received: from mga03.intel.com ([134.134.136.65]:4808 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728293AbfGWP7t (ORCPT ); Tue, 23 Jul 2019 11:59:49 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2019 08:59:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,299,1559545200"; d="scan'208";a="368416068" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by fmsmga005.fm.intel.com with ESMTP; 23 Jul 2019 08:59:46 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hpxCb-0004iG-Mk; Tue, 23 Jul 2019 18:59:45 +0300 Date: Tue, 23 Jul 2019 18:59:45 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Chuhong Yuan , Linus Walleij , linux-gpio , LKML Subject: Re: [PATCH v2] gpio: pch: Use dev_get_drvdata Message-ID: <20190723155945.GQ9224@smile.fi.intel.com> References: <20190723083923.21392-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 11:49:46AM +0200, Bartosz Golaszewski wrote: > wt., 23 lip 2019 o 10:39 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 > > --- > > Changes in v2: > > - Change the subject line to gpio: pch: ... > > > > 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 > > > > Acked-by: Bartosz Golaszewski Pushed to my review and testing queue, thanks! -- With Best Regards, Andy Shevchenko