Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8572954ybi; Tue, 23 Jul 2019 11:00:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYHInjdczT/WkiZBjm2LlQMitzFFMMQdkUOrxEZt+9EJTag3xo8EI9EVrS5PBEqAvVt6QW X-Received: by 2002:a17:90a:1d8:: with SMTP id 24mr84681816pjd.70.1563904850099; Tue, 23 Jul 2019 11:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563904850; cv=none; d=google.com; s=arc-20160816; b=YoT6p6JAAn/H3+hoxAVzVrFGuQjNaDJ++dX6evjJm3eAYZjWvBT+1Ju34tjRij5vSn vggsm3V7L0XLEqkaZ6gbHdsgjRDHJTDd8AHGutFALs0ELS13REjXrCc/0uWZi2skZ0SE Ou2W2u8ULpl0+08VMOVwdPrLIie+twN5JW9gjQRlLavj40jeg7kuLPoAMao9m2q8AW7V uP3qF0AVLRE1U5Il5t3e77RbEGPGZnrz4KRUgClHp639xXKgE0Lyx1s7/2ptKmSbOqWx R1waUgMM/piWWcCyioJ1GC6IcIocGil7iM9fJZ8wxGIxckn1BvjpFnX3boUnV3hjc4Up cYOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2Hh2BDdxorbNR5zjiFLHeW0WcNUHrtRdBmZjV1bKD+A=; b=1KrEbpXCDgsWeHonoVFrnnd4yut/fXx7/0+448sWiT7p+8zn+NgcWNymQiLwlZhT4d jMt7oNsxzBYr3eTEgrkv6l61Wl1d8Rzz0gOIfcCzbSh3dFrsvmsy/mM3sAGA5evs3Pp9 TFLp5Pv9C4tztZTi+smBtuJDFM3V9cwnlF8YLNwvrMgoGLBNrlVAKegJjji/chwd4u0B SeOgDzNbvkbGdIQpLXb0vMmIHX1lE9CqCNUA5CGRpWEqcsJLL1Rk7v3w1QrxNh2vq5fd UOtdmmruVlFccH21dsOLBuMge5WyRlga0raoJ7RS6FQAdDvPbs1d8AJeaM2WMbU6+n8w sihA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=C8EaRj9d; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r190si12035796pfr.102.2019.07.23.11.00.34; Tue, 23 Jul 2019 11:00:49 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=C8EaRj9d; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387473AbfGWIek (ORCPT + 99 others); Tue, 23 Jul 2019 04:34:40 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:33582 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727820AbfGWIek (ORCPT ); Tue, 23 Jul 2019 04:34:40 -0400 Received: by mail-oi1-f195.google.com with SMTP id u15so31729576oiv.0 for ; Tue, 23 Jul 2019 01:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=2Hh2BDdxorbNR5zjiFLHeW0WcNUHrtRdBmZjV1bKD+A=; b=C8EaRj9dizNUQ30NV1vxEnvoyAtMoMieHRuWAMgEq33P8Rdt6e2gzLQqMAgHG9Ffa2 4s44+JpxPoMF3U2PuGmYAQCFGFVNTMAJ52xkS0SM78s7J4gLGp6oQIIZj11qeOlH9/Q0 dnqgniXDFf1w3iqnM89GSv87EKmvNTDQ2EACRub+SHySCFt6WQ0doqB1e+1JXqUU4B8x OTeYOM98OBEU53HbYwuH2Y+V2R1PuMQBCCBMGZneEItuTwJjUfwLVR0hOA2ndopu1jTe isqBZ+ltTJi7Nn+/wtqt7p12iocoplRWCqFy/F0yI1joVHX1o17YUOIhN91HQFHNHvnC Cu/A== 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:content-transfer-encoding; bh=2Hh2BDdxorbNR5zjiFLHeW0WcNUHrtRdBmZjV1bKD+A=; b=LvCPfHEXoRO0BlIxek1wqlYpkCSXRXDqgHf6ixm93YYCNGs+i6xwdl7ckWXooS6qLU irNiuNMheiIGgd/JKHMPO+LKZNaGmC6DmgtsiLzfE3DQ3AXmyYeJpzUb8MsDx3NwlCyt jRVndAXSgSBcGNcoD5pNJeBRCiRCiBbvHXtl/Zmi6hoGjAahre0gI21gM9h88Z/uKVHq vb2GRYJEjYUDHYKnMzlJi4oUaCAc+DZ4uikzcMRO9jhRShKXhVNdWcKJ7Z0BKqyMdSGS DkRn+3psiMgQMULVlnNIhYcQfJutAhJnUF6xuNzO5uDSLvLijS8FZYxr/Xco4beZcaEb Obcg== X-Gm-Message-State: APjAAAVJdkvQjJVQYQUld2RXQck1b7+7H+PCSz6EFniCWDjnRJHgX3kL ll3MjLiyv0bvP1iHGqsKvax1WCbNWsbfjayA9JxwrA== X-Received: by 2002:a05:6808:f:: with SMTP id u15mr37441232oic.21.1563870879302; Tue, 23 Jul 2019 01:34:39 -0700 (PDT) MIME-Version: 1.0 References: <20190723082933.21134-1-hslester96@gmail.com> In-Reply-To: <20190723082933.21134-1-hslester96@gmail.com> From: Bartosz Golaszewski Date: Tue, 23 Jul 2019 10:34:28 +0200 Message-ID: Subject: Re: [PATCH] gpio: Use dev_get_drvdata To: Chuhong Yuan Cc: Andy Shevchenko , Linus Walleij , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wt., 23 lip 2019 o 10:29 Chuhong Yuan napisa=C5=82(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 =3D to_pci_dev(dev); > - struct pch_gpio *chip =3D pci_get_drvdata(pdev); > + struct pch_gpio *chip =3D 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 dev= ice *dev) > > static int __maybe_unused pch_gpio_resume(struct device *dev) > { > - struct pci_dev *pdev =3D to_pci_dev(dev); > - struct pch_gpio *chip =3D pci_get_drvdata(pdev); > + struct pch_gpio *chip =3D dev_get_drvdata(dev); > unsigned long flags; > > spin_lock_irqsave(&chip->spinlock, flags); > -- > 2.20.1 > The subject line should start with gpio: pch: ... Bart