tpm_nsc.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) | tpm_nsc.c (29412f0f6a19e34336368f13eab848091c343952) |
---|---|
1/* 2 * Copyright (C) 2004 IBM Corporation 3 * 4 * Authors: 5 * Leendert van Doorn <leendert@watson.ibm.com> 6 * Dave Safford <safford@watson.ibm.com> 7 * Reiner Sailer <sailer@watson.ibm.com> 8 * Kylene Hall <kjhall@us.ibm.com> --- 316 unchanged lines hidden (view full) --- 325 rc = -ENOMEM; 326 goto err_unreg_drv; 327 } 328 329 pdev->num_resources = 0; 330 pdev->dev.driver = &nsc_drv.driver; 331 pdev->dev.release = tpm_nsc_remove; 332 | 1/* 2 * Copyright (C) 2004 IBM Corporation 3 * 4 * Authors: 5 * Leendert van Doorn <leendert@watson.ibm.com> 6 * Dave Safford <safford@watson.ibm.com> 7 * Reiner Sailer <sailer@watson.ibm.com> 8 * Kylene Hall <kjhall@us.ibm.com> --- 316 unchanged lines hidden (view full) --- 325 rc = -ENOMEM; 326 goto err_unreg_drv; 327 } 328 329 pdev->num_resources = 0; 330 pdev->dev.driver = &nsc_drv.driver; 331 pdev->dev.release = tpm_nsc_remove; 332 |
333 if ((rc = platform_device_register(pdev)) < 0) 334 goto err_free_dev; | 333 if ((rc = platform_device_add(pdev)) < 0) 334 goto err_put_dev; |
335 336 if (request_region(base, 2, "tpm_nsc0") == NULL ) { 337 rc = -EBUSY; | 335 336 if (request_region(base, 2, "tpm_nsc0") == NULL ) { 337 rc = -EBUSY; |
338 goto err_unreg_dev; | 338 goto err_del_dev; |
339 } 340 341 if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) { 342 rc = -ENODEV; 343 goto err_rel_reg; 344 } 345 346 dev_dbg(&pdev->dev, "NSC TPM detected\n"); --- 30 unchanged lines hidden (view full) --- 377 tpm_read_index(nscAddrBase, 0x27) & 0x1F); 378 379 chip->vendor.base = base; 380 381 return 0; 382 383err_rel_reg: 384 release_region(base, 2); | 339 } 340 341 if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) { 342 rc = -ENODEV; 343 goto err_rel_reg; 344 } 345 346 dev_dbg(&pdev->dev, "NSC TPM detected\n"); --- 30 unchanged lines hidden (view full) --- 377 tpm_read_index(nscAddrBase, 0x27) & 0x1F); 378 379 chip->vendor.base = base; 380 381 return 0; 382 383err_rel_reg: 384 release_region(base, 2); |
385err_unreg_dev: 386 platform_device_unregister(pdev); 387err_free_dev: 388 kfree(pdev); | 385err_del_dev: 386 platform_device_del(pdev); 387err_put_dev: 388 platform_device_put(pdev); |
389err_unreg_drv: 390 platform_driver_unregister(&nsc_drv); 391 return rc; 392} 393 394static void __exit cleanup_nsc(void) 395{ 396 if (pdev) { --- 16 unchanged lines hidden --- | 389err_unreg_drv: 390 platform_driver_unregister(&nsc_drv); 391 return rc; 392} 393 394static void __exit cleanup_nsc(void) 395{ 396 if (pdev) { --- 16 unchanged lines hidden --- |