Commit 35ddd61c authored by Dan Carpenter's avatar Dan Carpenter Committed by Hans de Goede

platform/x86: x86-android-tablets: Fix an IS_ERR() vs NULL check in probe

The spi_new_device() function returns NULL on error, it doesn't return
error pointers.

Fixes: 70505ea6 ("platform/x86: x86-android-tablets: Add support for SPI device instantiation")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/4b1b2395-c7c5-44a4-b0b0-6d091c7f46a2@moroto.mountainReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 6e796485
......@@ -220,8 +220,8 @@ static __init int x86_instantiate_spi_dev(const struct x86_dev_info *dev_info, i
spi_devs[idx] = spi_new_device(controller, &board_info);
put_device(&controller->dev);
if (IS_ERR(spi_devs[idx]))
return dev_err_probe(&controller->dev, PTR_ERR(spi_devs[idx]),
if (!spi_devs[idx])
return dev_err_probe(&controller->dev, -ENOMEM,
"creating SPI-device %d\n", idx);
return 0;
......
Markdown is supported
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