From d511761745c7991949ab53c86a2338467cf7bc95 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 21 Jul 2009 16:00:27 +0100 Subject: [PATCH] --- yaml --- r: 165383 b: refs/heads/master c: 72b86876d437a33253a47373579787b6dcc3bd36 h: refs/heads/master i: 165381: 2cda0b63bd2d95ba9b6f4672b68127975c0c6842 165379: 906e6a71904d8d68b934c6b6b3d62dce94f49306 165375: f5d0b400dafbcd03b682d82c569ed89b7bd74806 v: v3 --- [refs] | 2 +- trunk/drivers/regulator/virtual.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 73223e187657..a0b159104eb8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9ed2099edca26d07947beb42c12bd1d6669e82bc +refs/heads/master: 72b86876d437a33253a47373579787b6dcc3bd36 diff --git a/trunk/drivers/regulator/virtual.c b/trunk/drivers/regulator/virtual.c index 144110788fd2..addc032c84bf 100644 --- a/trunk/drivers/regulator/virtual.c +++ b/trunk/drivers/regulator/virtual.c @@ -286,8 +286,7 @@ static int regulator_virtual_consumer_probe(struct platform_device *pdev) drvdata = kzalloc(sizeof(struct virtual_consumer_data), GFP_KERNEL); if (drvdata == NULL) { - ret = -ENOMEM; - goto err; + return -ENOMEM; } mutex_init(&drvdata->lock); @@ -302,8 +301,11 @@ static int regulator_virtual_consumer_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(attributes); i++) { ret = device_create_file(&pdev->dev, attributes[i]); - if (ret != 0) - goto err; + if (ret != 0) { + dev_err(&pdev->dev, "Failed to create attr %d: %d\n", + i, ret); + goto err_regulator; + } } drvdata->mode = regulator_get_mode(drvdata->regulator); @@ -312,6 +314,8 @@ static int regulator_virtual_consumer_probe(struct platform_device *pdev) return 0; +err_regulator: + regulator_put(drvdata->regulator); err: for (i = 0; i < ARRAY_SIZE(attributes); i++) device_remove_file(&pdev->dev, attributes[i]);