* [PATCH] ide: Use dev_get_drvdata where possible
@ 2019-07-23 11:49 Chuhong Yuan
2019-07-23 20:05 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-07-23 11:49 UTC (permalink / raw)
Cc: David S . Miller, linux-ide, 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/ide/siimage.c | 3 +--
drivers/ide/via82cxxx.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c
index 57eea5a9047f..c4b20f350b84 100644
--- a/drivers/ide/siimage.c
+++ b/drivers/ide/siimage.c
@@ -648,8 +648,7 @@ static void sil_quirkproc(ide_drive_t *drive)
static void init_iops_siimage(ide_hwif_t *hwif)
{
- struct pci_dev *dev = to_pci_dev(hwif->dev);
- struct ide_host *host = pci_get_drvdata(dev);
+ struct ide_host *host = dev_get_drvdata(hwif->dev);
hwif->hwif_data = NULL;
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c
index 977cb00398b0..63a3aca506fc 100644
--- a/drivers/ide/via82cxxx.c
+++ b/drivers/ide/via82cxxx.c
@@ -175,8 +175,7 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing)
static void via_set_drive(ide_hwif_t *hwif, ide_drive_t *drive)
{
ide_drive_t *peer = ide_get_pair_dev(drive);
- struct pci_dev *dev = to_pci_dev(hwif->dev);
- struct ide_host *host = pci_get_drvdata(dev);
+ struct ide_host *host = dev_get_drvdata(hwif->dev);
struct via82cxxx_dev *vdev = host->host_priv;
struct ide_timing t, p;
unsigned int T, UT;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ide: Use dev_get_drvdata where possible
2019-07-23 11:49 [PATCH] ide: Use dev_get_drvdata where possible Chuhong Yuan
@ 2019-07-23 20:05 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-07-23 20:05 UTC (permalink / raw)
To: hslester96; +Cc: linux-ide, linux-kernel
From: Chuhong Yuan <hslester96@gmail.com>
Date: Tue, 23 Jul 2019 19:49:52 +0800
> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-23 20:05 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:49 [PATCH] ide: Use dev_get_drvdata where possible Chuhong Yuan
2019-07-23 20:05 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.