Commit c4b54e13 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Linus Walleij
Browse files

gpio: mockup: fix a return value check

The return value of platform_device_register_resndata() on error is
an error code converted to pointer with ERR_PTR(), not NULL.

Check the return value correctly.

Fixes: 8a39f597

 ("gpio: mockup: rework device probing")
Signed-off-by: default avatarBartosz Golaszewski <>
Signed-off-by: default avatarLinus Walleij <>
parent e0fc62a6
......@@ -387,11 +387,11 @@ static int __init gpio_mockup_init(void)
i, NULL, 0, &pdata,
if (!pdev) {
if (IS_ERR(pdev)) {
gpio_mockup_err("error registering device");
return -ENOMEM;
return PTR_ERR(pdev);
gpio_mockup_pdevs[i] = pdev;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment