summaryrefslogtreecommitdiff
path: root/drivers/memstick/host
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-23 19:50:44 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2019-09-11 15:58:39 +0200
commitdeaa53989537c62f15ed2570a95e10539ae2c877 (patch)
treea475ed56d0c5d3e1847fdcda72d686b3cbe3fedb /drivers/memstick/host
parent90b51e3c5b3964d6be6f59d4e022e61a8bc258e9 (diff)
memstick: r592: Use dev_get_drvdata
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> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/memstick/host')
-rw-r--r--drivers/memstick/host/r592.c6
1 files 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);