regulator: Fix checking return value of create_regulator

create_regulator() returns NULL on fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Axel Lin 2011-12-29 17:03:20 +08:00 коммит произвёл Mark Brown
Родитель bcda432194
Коммит 32c78de8f1
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -985,9 +985,8 @@ static int set_supply(struct regulator_dev *rdev,
rdev_info(rdev, "supplied by %s\n", rdev_get_name(supply_rdev)); rdev_info(rdev, "supplied by %s\n", rdev_get_name(supply_rdev));
rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY"); rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY");
if (IS_ERR(rdev->supply)) { if (rdev->supply == NULL) {
err = PTR_ERR(rdev->supply); err = -ENOMEM;
rdev->supply = NULL;
return err; return err;
} }