sdk/linux_kernel_drivers/xocl/xocl_drv.c
// TODO: Umang remove the additional DRM_INFO's once this driver has been
// in production for some time. 07/06/2017.
Umang remove the additional DRM_INFO's once this driver has been
in production for some time.
Umang remove the additional DRM_INFO ' s once this driver has been in production for some time .
static int xocl_driver_load(struct pci_dev *pdev,
			  const struct pci_device_id *ent)
{
	struct drm_device *dev;
	int ret;
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	dev = drm_dev_alloc(&xocl_drm_driver, &pdev->dev);
	if (IS_ERR(dev))
		return PTR_ERR(dev);
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	ret = pci_enable_device(pdev);
	if (ret)
		goto err_free;
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	dev->pdev = pdev;
	pci_set_drvdata(pdev, dev);
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	ret = drm_dev_register(dev, ent->driver_data);
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	if (ret) {
		goto err_reg;
	}
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	return 0;
err_reg:
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	pci_disable_device(pdev);
err_free:
	DRM_INFO("%s:%d:%s()", __FILE__, __LINE__, __func__);
	drm_dev_unref(dev);
	return ret;
}
static int xocl_driver_load ( struct pci_dev * pdev , const struct pci_device_id * ent ) { struct drm_device * dev ; int ret ; DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; dev = drm_dev_alloc ( & xocl_drm_driver , & pdev -> dev ) ; if ( IS_ERR ( dev ) ) return PTR_ERR ( dev ) ; DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; ret = pci_enable_device ( pdev ) ; if ( ret ) goto err_free ; DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; dev -> pdev = pdev ; pci_set_drvdata ( pdev , dev ) ; DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; ret = drm_dev_register ( dev , ent -> driver_data ) ; DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; if ( ret ) { goto err_reg ; } DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; return 0 ; err_reg : DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; pci_disable_device ( pdev ) ; err_free : DRM_INFO ( " " , __FILE__ , __LINE__ , __func__ ) ; drm_dev_unref ( dev ) ; return ret ; }
TODO: Umang remove the additional DRM_INFO's once this driver has been
in production for some time.
TODO : Umang remove the additional DRM_INFO ' s once this driver has been in production for some time .