* [PATCH] memstick: r592: Use dev_get_drvdata
@ 2019-07-23 11:50 Chuhong Yuan
2019-07-24 14:08 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-07-23 11:50 UTC (permalink / raw)
Cc: Maxim Levitsky, Alex Dubov, Ulf Hansson, linux-mmc, linux-kernel,
Chuhong Yuan
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>
---
drivers/memstick/host/r592.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c
index 2932f421b3ea..dd3a1f3dcc19 100644
--- a/drivers/memstick/host/r592.c
+++ b/drivers/memstick/host/r592.c
@@ -847,8 +847,7 @@ static void r592_remove(struct pci_dev *pdev)
#ifdef CONFIG_PM_SLEEP
static int r592_suspend(struct device *core_dev)
{
- struct pci_dev *pdev = to_pci_dev(core_dev);
- struct r592_device *dev = pci_get_drvdata(pdev);
+ struct r592_device *dev = dev_get_drvdata(core_dev);
r592_clear_interrupts(dev);
memstick_suspend_host(dev->host);
@@ -858,8 +857,7 @@ static int r592_suspend(struct device *core_dev)
static int r592_resume(struct device *core_dev)
{
- struct pci_dev *pdev = to_pci_dev(core_dev);
- struct r592_device *dev = pci_get_drvdata(pdev);
+ struct r592_device *dev = dev_get_drvdata(core_dev);
r592_clear_interrupts(dev);
r592_enable_device(dev, false);
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] memstick: r592: Use dev_get_drvdata
2019-07-23 11:50 [PATCH] memstick: r592: Use dev_get_drvdata Chuhong Yuan
@ 2019-07-24 14:08 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2019-07-24 14:08 UTC (permalink / raw)
To: Chuhong Yuan
Cc: Maxim Levitsky, Alex Dubov, linux-mmc, Linux Kernel Mailing List
On Tue, 23 Jul 2019 at 13:50, Chuhong Yuan <hslester96@gmail.com> wrote:
>
> 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>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/memstick/host/r592.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c
> index 2932f421b3ea..dd3a1f3dcc19 100644
> --- a/drivers/memstick/host/r592.c
> +++ b/drivers/memstick/host/r592.c
> @@ -847,8 +847,7 @@ static void r592_remove(struct pci_dev *pdev)
> #ifdef CONFIG_PM_SLEEP
> static int r592_suspend(struct device *core_dev)
> {
> - struct pci_dev *pdev = to_pci_dev(core_dev);
> - struct r592_device *dev = pci_get_drvdata(pdev);
> + struct r592_device *dev = dev_get_drvdata(core_dev);
>
> r592_clear_interrupts(dev);
> memstick_suspend_host(dev->host);
> @@ -858,8 +857,7 @@ static int r592_suspend(struct device *core_dev)
>
> static int r592_resume(struct device *core_dev)
> {
> - struct pci_dev *pdev = to_pci_dev(core_dev);
> - struct r592_device *dev = pci_get_drvdata(pdev);
> + struct r592_device *dev = dev_get_drvdata(core_dev);
>
> r592_clear_interrupts(dev);
> r592_enable_device(dev, false);
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-24 14:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 11:50 [PATCH] memstick: r592: Use dev_get_drvdata Chuhong Yuan
2019-07-24 14:08 ` Ulf Hansson
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).