Loading drivers/mfd/88pm860x-core.c +2 −3 Original line number Original line Diff line number Diff line Loading @@ -1150,7 +1150,8 @@ static int pm860x_probe(struct i2c_client *client, return -EINVAL; return -EINVAL; } } chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); chip = devm_kzalloc(&client->dev, sizeof(struct pm860x_chip), GFP_KERNEL); if (chip == NULL) if (chip == NULL) return -ENOMEM; return -ENOMEM; Loading @@ -1160,7 +1161,6 @@ static int pm860x_probe(struct i2c_client *client, ret = PTR_ERR(chip->regmap); ret = PTR_ERR(chip->regmap); dev_err(&client->dev, "Failed to allocate register map: %d\n", dev_err(&client->dev, "Failed to allocate register map: %d\n", ret); ret); kfree(chip); return ret; return ret; } } chip->client = client; chip->client = client; Loading Loading @@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client) regmap_exit(chip->regmap_companion); regmap_exit(chip->regmap_companion); i2c_unregister_device(chip->companion); i2c_unregister_device(chip->companion); } } kfree(chip); return 0; return 0; } } Loading Loading
drivers/mfd/88pm860x-core.c +2 −3 Original line number Original line Diff line number Diff line Loading @@ -1150,7 +1150,8 @@ static int pm860x_probe(struct i2c_client *client, return -EINVAL; return -EINVAL; } } chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); chip = devm_kzalloc(&client->dev, sizeof(struct pm860x_chip), GFP_KERNEL); if (chip == NULL) if (chip == NULL) return -ENOMEM; return -ENOMEM; Loading @@ -1160,7 +1161,6 @@ static int pm860x_probe(struct i2c_client *client, ret = PTR_ERR(chip->regmap); ret = PTR_ERR(chip->regmap); dev_err(&client->dev, "Failed to allocate register map: %d\n", dev_err(&client->dev, "Failed to allocate register map: %d\n", ret); ret); kfree(chip); return ret; return ret; } } chip->client = client; chip->client = client; Loading Loading @@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client) regmap_exit(chip->regmap_companion); regmap_exit(chip->regmap_companion); i2c_unregister_device(chip->companion); i2c_unregister_device(chip->companion); } } kfree(chip); return 0; return 0; } } Loading