node-drivers/base-driver/drivers/vca/plx87xx/plx_main.c
static int plx_device_create(struct plx_device **xdevp, struct pci_dev *pdev)
{
	int rc = 0;
	struct plx_device *xdev;
	xdev = kzalloc(sizeof(*xdev), GFP_KERNEL);
	if (!xdev) {
		rc = -ENOMEM;
		dev_err(&pdev->dev, "xdev kmalloc failed rc %d\n", rc);
		goto finish;
	}

	xdev->id = ida_simple_get(&g_plx_ida, 0, VCA_MAX_NUM_CPUS, GFP_KERNEL);
	if (xdev->id < 0) {
		rc = xdev->id;
		dev_err(&pdev->dev, "ida_simple_get failed rc %d\n", rc);
		goto ida_fail;
	}

	*xdevp = xdev;
	goto finish;

ida_fail:
	kfree(xdev);
finish:
	return rc;
}
/**
 * plx_device_create - Creates plx device
 * @xdev: Pointer to created device
 * @pdev: PCI device structure
 * returns 0 on success, < 0 on failure.
 */
Creates plx device
@xdev: Pointer to created device
@pdev: PCI device structure
returns 0 on success, < 0 on failure.
Creates plx device @xdev : Pointer to created device @pdev : PCI device structure returns 0 on success < 0 on failure .
static int plx_device_create(struct plx_device **xdevp, struct pci_dev *pdev)
{
	int rc = 0;
	struct plx_device *xdev;
	xdev = kzalloc(sizeof(*xdev), GFP_KERNEL);
	if (!xdev) {
		rc = -ENOMEM;
		dev_err(&pdev->dev, "xdev kmalloc failed rc %d\n", rc);
		goto finish;
	}
	xdev->id = ida_simple_get(&g_plx_ida, 0, VCA_MAX_NUM_CPUS, GFP_KERNEL);
	if (xdev->id < 0) {
		rc = xdev->id;
		dev_err(&pdev->dev, "ida_simple_get failed rc %d\n", rc);
		goto ida_fail;
	}
	*xdevp = xdev;
	goto finish;
ida_fail:
	kfree(xdev);
finish:
	return rc;
}
static int plx_device_create ( struct plx_device * * xdevp , struct pci_dev * pdev ) { int rc = 0 ; struct plx_device * xdev ; xdev = kzalloc ( sizeof ( * xdev ) , GFP_KERNEL ) ; if ( ! xdev ) { rc = - ENOMEM ; dev_err ( & pdev -> dev , " \n " , rc ) ; goto finish ; } xdev -> id = ida_simple_get ( & g_plx_ida , 0 , VCA_MAX_NUM_CPUS , GFP_KERNEL ) ; if ( xdev -> id < 0 ) { rc = xdev -> id ; dev_err ( & pdev -> dev , " \n " , rc ) ; goto ida_fail ; } * xdevp = xdev ; goto finish ; ida_fail : kfree ( xdev ) ; finish : return rc ; }
plx_device_create - Creates plx device
 @xdev: Pointer to created device
 @pdev: PCI device structure
 returns 0 on success, < 0 on failure.
plx_device_create - Creates plx device @xdev : Pointer to created device @pdev : PCI device structure returns 0 on success < 0 on failure .