summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/surface3_power.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/surface3_power.c')
-rw-r--r--drivers/platform/x86/surface3_power.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/surface3_power.c b/drivers/platform/x86/surface3_power.c
index 946ac2dc08ae..cc4f9cba6856 100644
--- a/drivers/platform/x86/surface3_power.c
+++ b/drivers/platform/x86/surface3_power.c
@@ -522,8 +522,8 @@ static int mshw0011_probe(struct i2c_client *client)
strlcpy(board_info.type, "MSHW0011-bat0", I2C_NAME_SIZE);
bat0 = i2c_acpi_new_device(dev, 1, &board_info);
- if (!bat0)
- return -ENOMEM;
+ if (IS_ERR(bat0))
+ return PTR_ERR(bat0);
data->bat0 = bat0;
i2c_set_clientdata(bat0, data);