Loading drivers/regulator/fixed.c +2 −3 Original line number Diff line number Diff line Loading @@ -176,7 +176,8 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev) if (!config) return -ENOMEM; drvdata = kzalloc(sizeof(struct fixed_voltage_data), GFP_KERNEL); drvdata = devm_kzalloc(&pdev->dev, sizeof(struct fixed_voltage_data), GFP_KERNEL); if (drvdata == NULL) { dev_err(&pdev->dev, "Failed to allocate device data\n"); ret = -ENOMEM; Loading Loading @@ -270,7 +271,6 @@ err_gpio: err_name: kfree(drvdata->desc.name); err: kfree(drvdata); return ret; } Loading @@ -282,7 +282,6 @@ static int __devexit reg_fixed_voltage_remove(struct platform_device *pdev) if (gpio_is_valid(drvdata->gpio)) gpio_free(drvdata->gpio); kfree(drvdata->desc.name); kfree(drvdata); return 0; } Loading Loading
drivers/regulator/fixed.c +2 −3 Original line number Diff line number Diff line Loading @@ -176,7 +176,8 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev) if (!config) return -ENOMEM; drvdata = kzalloc(sizeof(struct fixed_voltage_data), GFP_KERNEL); drvdata = devm_kzalloc(&pdev->dev, sizeof(struct fixed_voltage_data), GFP_KERNEL); if (drvdata == NULL) { dev_err(&pdev->dev, "Failed to allocate device data\n"); ret = -ENOMEM; Loading Loading @@ -270,7 +271,6 @@ err_gpio: err_name: kfree(drvdata->desc.name); err: kfree(drvdata); return ret; } Loading @@ -282,7 +282,6 @@ static int __devexit reg_fixed_voltage_remove(struct platform_device *pdev) if (gpio_is_valid(drvdata->gpio)) gpio_free(drvdata->gpio); kfree(drvdata->desc.name); kfree(drvdata); return 0; } Loading