From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio <linux-gpio@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] gpio: pch: Use dev_get_drvdata
Date: Tue, 23 Jul 2019 11:49:46 +0200 [thread overview]
Message-ID: <CAMpxmJXkg8wiLOj9rQs+aNx+_oqb_tUWeELmrWQd7GXi-qAueA@mail.gmail.com> (raw)
In-Reply-To: <20190723083923.21392-1-hslester96@gmail.com>
wt., 23 lip 2019 o 10:39 Chuhong Yuan <hslester96@gmail.com> napisał(a):
>
> Instead of using to_pci_dev + pci_get_drvdata,
> use dev_get_drvdata to make code simpler.
>
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> 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 <bgolaszewski@baylibre.com>
next prev parent reply other threads:[~2019-07-23 9:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-23 8:39 [PATCH v2] gpio: pch: Use dev_get_drvdata Chuhong Yuan
2019-07-23 9:49 ` Bartosz Golaszewski [this message]
2019-07-23 15:59 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMpxmJXkg8wiLOj9rQs+aNx+_oqb_tUWeELmrWQd7GXi-qAueA@mail.gmail.com \
--to=bgolaszewski@baylibre.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hslester96@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).