From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CB1EC7618B for ; Tue, 23 Jul 2019 15:40:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 726A3217D4 for ; Tue, 23 Jul 2019 15:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388740AbfGWPkB (ORCPT ); Tue, 23 Jul 2019 11:40:01 -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