From: Jonathan Cameron <jic23@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: <linux-iio@vger.kernel.org>, <jonathan.cameron@huawei.com>,
<lars@metafoo.de>
Subject: Re: [PATCH -next] iio: trigger: sysfs: rename error label in iio_sysfs_trigger_probe()
Date: Sat, 29 Oct 2022 13:48:56 +0100 [thread overview]
Message-ID: <20221029134856.03ea79e4@jic23-huawei> (raw)
In-Reply-To: <20221024105250.873394-1-yangyingliang@huawei.com>
On Mon, 24 Oct 2022 18:52:50 +0800
Yang Yingliang <yangyingliang@huawei.com> wrote:
> Rename error label in iio_sysfs_trigger_probe() to make more readable.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Nice
Applied to the togreg branch of iio.git and pushed out as testing to let
the autobuilders see if they can find anything we missed.
Thanks,
Jonathan
> ---
> drivers/iio/trigger/iio-trig-sysfs.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c
> index d6c5e9644738..63ce01ac2036 100644
> --- a/drivers/iio/trigger/iio-trig-sysfs.c
> +++ b/drivers/iio/trigger/iio-trig-sysfs.c
> @@ -138,18 +138,18 @@ static int iio_sysfs_trigger_probe(int id)
> }
> if (foundit) {
> ret = -EINVAL;
> - goto out1;
> + goto err_unlock;
> }
> t = kmalloc(sizeof(*t), GFP_KERNEL);
> if (t == NULL) {
> ret = -ENOMEM;
> - goto out1;
> + goto err_unlock;
> }
> t->id = id;
> t->trig = iio_trigger_alloc(&iio_sysfs_trig_dev, "sysfstrig%d", id);
> if (!t->trig) {
> ret = -ENOMEM;
> - goto free_t;
> + goto err_free_sys_trig;
> }
>
> t->trig->dev.groups = iio_sysfs_trigger_attr_groups;
> @@ -159,17 +159,17 @@ static int iio_sysfs_trigger_probe(int id)
>
> ret = iio_trigger_register(t->trig);
> if (ret)
> - goto out2;
> + goto err_free_trig;
> list_add(&t->l, &iio_sysfs_trig_list);
> __module_get(THIS_MODULE);
> mutex_unlock(&iio_sysfs_trig_list_mut);
> return 0;
>
> -out2:
> +err_free_trig:
> iio_trigger_free(t->trig);
> -free_t:
> +err_free_sys_trig:
> kfree(t);
> -out1:
> +err_unlock:
> mutex_unlock(&iio_sysfs_trig_list_mut);
> return ret;
> }
prev parent reply other threads:[~2022-10-29 12:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 10:52 [PATCH -next] iio: trigger: sysfs: rename error label in iio_sysfs_trigger_probe() Yang Yingliang
2022-10-29 12:48 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221029134856.03ea79e4@jic23-huawei \
--to=jic23@kernel.org \
--cc=jonathan.cameron@huawei.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox