Skip to content
Snippets Groups Projects
Select Git revision
  • c39191feed4540fed98badeb484833dcf659bb96
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

drm_context.c

Blame
  • ionic_bus_pci.c 1.23 KiB
    // SPDX-License-Identifier: GPL-2.0
    /* Copyright(c) 2017 - 2019 Pensando Systems, Inc */
    
    #include <linux/module.h>
    #include <linux/netdevice.h>
    #include <linux/etherdevice.h>
    #include <linux/pci.h>
    
    #include "ionic.h"
    #include "ionic_bus.h"
    
    /* Supported devices */
    static const struct pci_device_id ionic_id_table[] = {
    	{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF) },
    	{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF) },
    	{ 0, }	/* end of table */
    };
    MODULE_DEVICE_TABLE(pci, ionic_id_table);
    
    static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
    {
    	struct device *dev = &pdev->dev;
    	struct ionic *ionic;
    
    	ionic = ionic_devlink_alloc(dev);
    	if (!ionic)
    		return -ENOMEM;
    
    	ionic->pdev = pdev;
    	ionic->dev = dev;
    	pci_set_drvdata(pdev, ionic);
    
    	return 0;
    }
    
    static void ionic_remove(struct pci_dev *pdev)
    {
    	struct ionic *ionic = pci_get_drvdata(pdev);
    
    	ionic_devlink_free(ionic);
    }
    
    static struct pci_driver ionic_driver = {
    	.name = IONIC_DRV_NAME,
    	.id_table = ionic_id_table,
    	.probe = ionic_probe,
    	.remove = ionic_remove,
    };
    
    int ionic_bus_register_driver(void)
    {
    	return pci_register_driver(&ionic_driver);
    }
    
    void ionic_bus_unregister_driver(void)
    {
    	pci_unregister_driver(&ionic_driver);
    }