diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-12-08 13:24:46 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-12-14 06:59:19 -0700 |
commit | 2920417c98dbe4b58200c12fc9dc152834b76e42 (patch) | |
tree | e3839dfcfbc36b9a51c25be3b01c1187ca10ea42 /drivers/block | |
parent | 52a0cab35c568f896067641d8e07f798341954f5 (diff) | |
download | linux-stable-2920417c98dbe4b58200c12fc9dc152834b76e42.tar.gz linux-stable-2920417c98dbe4b58200c12fc9dc152834b76e42.tar.bz2 linux-stable-2920417c98dbe4b58200c12fc9dc152834b76e42.zip |
mtip32xx: remove pointless drvdata checking
The .suspend() and .resume() methods are only called after the .probe()
method (mtip_pci_probe()) has set the drvdata and returned success.
Therefore, if we get to mtip_pci_suspend() or mtip_pci_resume(), the
drvdata must be valid. Drop the unnecessary checking.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20211208192449.146076-2-helgaas@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 30f471021a40..715ef350df54 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -4150,12 +4150,6 @@ static int mtip_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) int rv = 0; struct driver_data *dd = pci_get_drvdata(pdev); - if (!dd) { - dev_err(&pdev->dev, - "Driver private datastructure is NULL\n"); - return -EFAULT; - } - set_bit(MTIP_DDF_RESUME_BIT, &dd->dd_flag); /* Disable ports & interrupts then send standby immediate */ @@ -4189,14 +4183,7 @@ static int mtip_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) static int mtip_pci_resume(struct pci_dev *pdev) { int rv = 0; - struct driver_data *dd; - - dd = pci_get_drvdata(pdev); - if (!dd) { - dev_err(&pdev->dev, - "Driver private datastructure is NULL\n"); - return -EFAULT; - } + struct driver_data *dd = pci_get_drvdata(pdev); /* Move the device to active State */ pci_set_power_state(pdev, PCI_D0); |