ide: Use dev_get_drvdata where possible
authorChuhong Yuan <hslester96@gmail.com>
Tue, 23 Jul 2019 11:49:52 +0000 (19:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Jul 2019 20:04:54 +0000 (13:04 -0700)
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: David S. Miller <davem@davemloft.net>
drivers/ide/siimage.c
drivers/ide/via82cxxx.c

index 57eea5a9047f5072093b598d1076b52008564bc6..c4b20f350b84bbb55d9786c9e7809a4a346c0343 100644 (file)
@@ -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;
 
index 977cb00398b044dcf3f9291bc8c3157dc993fa26..63a3aca506fca494ecb307932b5bd98882ec0867 100644 (file)
@@ -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;