Commit 41342715 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski

gpio: sim: use devm_mutex_init()

Drop the hand-coded devres action callback for destroying the mutex in
favor of devm_mutex_init().
Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240610140548.35358-4-brgl@bgdev.plSigned-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent b5f5cbee
......@@ -308,13 +308,6 @@ static ssize_t gpio_sim_sysfs_pull_store(struct device *dev,
return len;
}
static void gpio_sim_mutex_destroy(void *data)
{
struct mutex *lock = data;
mutex_destroy(lock);
}
static void gpio_sim_put_device(void *data)
{
struct device *dev = data;
......@@ -458,9 +451,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
if (ret)
return ret;
mutex_init(&chip->lock);
ret = devm_add_action_or_reset(dev, gpio_sim_mutex_destroy,
&chip->lock);
ret = devm_mutex_init(dev, &chip->lock);
if (ret)
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment