Commit f7626504 authored by Yang Yingliang's avatar Yang Yingliang Committed by Jonathan Cameron

iio: trigger: sysfs: rename error label in iio_sysfs_trigger_probe()

Rename error label in iio_sysfs_trigger_probe() to make more readable.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221024105250.873394-1-yangyingliang@huawei.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a95ccebd
...@@ -138,18 +138,18 @@ static int iio_sysfs_trigger_probe(int id) ...@@ -138,18 +138,18 @@ static int iio_sysfs_trigger_probe(int id)
} }
if (foundit) { if (foundit) {
ret = -EINVAL; ret = -EINVAL;
goto out1; goto err_unlock;
} }
t = kmalloc(sizeof(*t), GFP_KERNEL); t = kmalloc(sizeof(*t), GFP_KERNEL);
if (t == NULL) { if (t == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto out1; goto err_unlock;
} }
t->id = id; t->id = id;
t->trig = iio_trigger_alloc(&iio_sysfs_trig_dev, "sysfstrig%d", id); t->trig = iio_trigger_alloc(&iio_sysfs_trig_dev, "sysfstrig%d", id);
if (!t->trig) { if (!t->trig) {
ret = -ENOMEM; ret = -ENOMEM;
goto free_t; goto err_free_sys_trig;
} }
t->trig->dev.groups = iio_sysfs_trigger_attr_groups; t->trig->dev.groups = iio_sysfs_trigger_attr_groups;
...@@ -159,17 +159,17 @@ static int iio_sysfs_trigger_probe(int id) ...@@ -159,17 +159,17 @@ static int iio_sysfs_trigger_probe(int id)
ret = iio_trigger_register(t->trig); ret = iio_trigger_register(t->trig);
if (ret) if (ret)
goto out2; goto err_free_trig;
list_add(&t->l, &iio_sysfs_trig_list); list_add(&t->l, &iio_sysfs_trig_list);
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
mutex_unlock(&iio_sysfs_trig_list_mut); mutex_unlock(&iio_sysfs_trig_list_mut);
return 0; return 0;
out2: err_free_trig:
iio_trigger_free(t->trig); iio_trigger_free(t->trig);
free_t: err_free_sys_trig:
kfree(t); kfree(t);
out1: err_unlock:
mutex_unlock(&iio_sysfs_trig_list_mut); mutex_unlock(&iio_sysfs_trig_list_mut);
return 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