From e3dd8cd4778ebc75c654f73d8673281078c81ed9 Mon Sep 17 00:00:00 2001 From: Alexandre Bounine Date: Tue, 22 Mar 2016 14:26:08 -0700 Subject: rapidio/tsi721: add shutdown notification callback Add device driver specific shutdown notification callback. Signed-off-by: Alexandre Bounine Cc: Matt Porter Cc: Aurelien Jacquiot Cc: Andre van Herk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rapidio/devices/tsi721.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/rapidio/devices/tsi721.c') diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c index cd40f0f9fbfe..1fc9663ae3b5 100644 --- a/drivers/rapidio/devices/tsi721.c +++ b/drivers/rapidio/devices/tsi721.c @@ -2638,6 +2638,8 @@ static int tsi721_probe(struct pci_dev *pdev, if (err) goto err_free_consistent; + pci_set_drvdata(pdev, priv); + return 0; err_free_consistent: @@ -2660,6 +2662,18 @@ err_exit: return err; } +static void tsi721_shutdown(struct pci_dev *pdev) +{ + struct tsi721_device *priv = pci_get_drvdata(pdev); + + dev_dbg(&pdev->dev, "RIO: %s\n", __func__); + + tsi721_disable_ints(priv); + tsi721_dma_stop_all(priv); + pci_clear_master(pdev); + pci_disable_device(pdev); +} + static const struct pci_device_id tsi721_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_IDT, PCI_DEVICE_ID_TSI721) }, { 0, } /* terminate list */ @@ -2671,6 +2685,7 @@ static struct pci_driver tsi721_driver = { .name = "tsi721", .id_table = tsi721_pci_tbl, .probe = tsi721_probe, + .shutdown = tsi721_shutdown, }; static int __init tsi721_init(void) -- cgit v1.2.3