mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mtd: gpmi: Use devm_kzalloc()
Using devm_kzalloc() can make the code simpler. Signed-off-by: Fabio Estevam <[email protected]> Acked-by: Huang Shijie <[email protected]> Signed-off-by: Brian Norris <[email protected]>
This commit is contained in:
parent
a749d13acd
commit
edaf4d4aad
1 changed files with 1 additions and 3 deletions
|
|
@ -1732,7 +1732,7 @@ static int gpmi_nand_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
this = kzalloc(sizeof(*this), GFP_KERNEL);
|
||||
this = devm_kzalloc(&pdev->dev, sizeof(*this), GFP_KERNEL);
|
||||
if (!this) {
|
||||
pr_err("Failed to allocate per-device memory\n");
|
||||
return -ENOMEM;
|
||||
|
|
@ -1762,7 +1762,6 @@ exit_nfc_init:
|
|||
release_resources(this);
|
||||
exit_acquire_resources:
|
||||
dev_err(this->dev, "driver registration failed: %d\n", ret);
|
||||
kfree(this);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1773,7 +1772,6 @@ static int gpmi_nand_remove(struct platform_device *pdev)
|
|||
|
||||
gpmi_nfc_exit(this);
|
||||
release_resources(this);
|
||||
kfree(this);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue