mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
pinctrl/spear/plgpio: Delete two error messages for a failed memory allocation in plgpio_probe()
Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
221173a3fc
commit
b5623acb8d
1 changed files with 2 additions and 6 deletions
|
|
@ -519,10 +519,8 @@ static int plgpio_probe(struct platform_device *pdev)
|
|||
int ret, irq;
|
||||
|
||||
plgpio = devm_kzalloc(&pdev->dev, sizeof(*plgpio), GFP_KERNEL);
|
||||
if (!plgpio) {
|
||||
dev_err(&pdev->dev, "memory allocation fail\n");
|
||||
if (!plgpio)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
plgpio->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
|
|
@ -544,10 +542,8 @@ static int plgpio_probe(struct platform_device *pdev)
|
|||
sizeof(*plgpio->csave_regs) *
|
||||
DIV_ROUND_UP(plgpio->chip.ngpio, MAX_GPIO_PER_REG),
|
||||
GFP_KERNEL);
|
||||
if (!plgpio->csave_regs) {
|
||||
dev_err(&pdev->dev, "csave registers memory allocation fail\n");
|
||||
if (!plgpio->csave_regs)
|
||||
return -ENOMEM;
|
||||
}
|
||||
#endif
|
||||
|
||||
platform_set_drvdata(pdev, plgpio);
|
||||
|
|
|
|||
Loading…
Reference in a new issue