platform/x86: mlx-platform: Fix an ERR_PTR vs NULL issue
[muen/linux.git] / drivers / platform / x86 / mlx-platform.c
index dfecba4407ac4a810cc6a9846b6505122c95265b..27de29961f5e194c990ba3f6427aac09ede9e6f1 100644 (file)
@@ -522,8 +522,8 @@ static int __init mlxplat_init(void)
 
        mlxplat_mlxcpld_regmap_ctx.base = devm_ioport_map(&mlxplat_dev->dev,
                               mlxplat_lpc_resources[1].start, 1);
-       if (IS_ERR(mlxplat_mlxcpld_regmap_ctx.base)) {
-               err = PTR_ERR(mlxplat_mlxcpld_regmap_ctx.base);
+       if (!mlxplat_mlxcpld_regmap_ctx.base) {
+               err = -ENOMEM;
                goto fail_platform_mux_register;
        }