static struct regulator *create_regulator(struct regulator_dev *rdev,
struct device *dev,
const char *supply_name);
+++++static void _regulator_put(struct regulator *regulator);
++++
+++++ static struct regulator_dev *dev_to_rdev(struct device *dev)
+++++ {
+++++ return container_of(dev, struct regulator_dev, dev);
+++++ }
+
static const char *rdev_get_name(struct regulator_dev *rdev)
{
if (rdev->constraints && rdev->constraints->name)
{
struct regulator_dev *rdev;
----- if (regulator == NULL || IS_ERR(regulator))
+++++ if (IS_ERR_OR_NULL(regulator))
return;
++++ lockdep_assert_held_once(®ulator_list_mutex);
++++
rdev = regulator->rdev;
debugfs_remove_recursive(regulator->debugfs);
WARN_ON(rdev->open_count);
unset_regulator_supplies(rdev);
list_del(&rdev->list);
---- kfree(rdev->constraints);
++++ mutex_unlock(®ulator_list_mutex);
- kfree(rdev->constraints);
regulator_ena_gpio_free(rdev);
----- of_node_put(rdev->dev.of_node);
device_unregister(&rdev->dev);
---- mutex_unlock(®ulator_list_mutex);
}
EXPORT_SYMBOL_GPL(regulator_unregister);