 memset(pdev, 0, sizeof(struct platform_device)); 
static int __init init_atmel(void){	int rc = 0;	int lo, hi;	driver_register(&atml_drv);	lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO);	hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI);	tpm_atmel.base = (hi<<8)|lo;	/* verify that it is an Atmel part */	if (tpm_read_index(TPM_ADDR, 4) != 'A' || tpm_read_index(TPM_ADDR, 5) != 'T'	    || tpm_read_index(TPM_ADDR, 6) != 'M' || tpm_read_index(TPM_ADDR, 7) != 'L') {		return -ENODEV;	}	/* verify chip version number is 1.1 */	if (	(tpm_read_index(TPM_ADDR, 0x00) != 0x01) ||		(tpm_read_index(TPM_ADDR, 0x01) != 0x01 ))		return -ENODEV;	pdev = kmalloc(sizeof(struct platform_device), GFP_KERNEL);	if ( !pdev )		return -ENOMEM;	memset(pdev, 0, sizeof(struct platform_device));	pdev->name = "tpm_atmel0";	pdev->id = -1;	pdev->num_resources = 0;	pdev->dev.release = tpm_atml_remove;	pdev->dev.driver = &atml_drv;	if ((rc=platform_device_register(pdev)) < 0) {		kfree(pdev);		pdev = NULL;		return rc;	}	if (request_region(tpm_atmel.base, 2, "tpm_atmel0") == NULL ) {		platform_device_unregister(pdev);		kfree(pdev);		pdev = NULL;		return -EBUSY;	}	if ((rc = tpm_register_hardware(&pdev->dev, &tpm_atmel)) < 0) {		release_region(tpm_atmel.base, 2);		platform_device_unregister(pdev);		kfree(pdev);		pdev = NULL;		return rc;	}	dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n", tpm_atmel.base);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b888c87b7498557d1dbb9de3d4b8402b1bb89193/tpm_atmel.c/buggy/drivers/char/tpm/tpm_atmel.c