All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-iio@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hartmut Knaack <knaack.h@gmx.de>,
	Jonathan Cameron <jic23@kernel.org>, Kangjie Lu <kjlu@umn.edu>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH v2] iio: magnetometer: ak8974: Fix runtime PM imbalance on error in ak8974_probe()
Date: Sun, 31 May 2020 16:06:11 +0200	[thread overview]
Message-ID: <dd84c12f-277d-27e7-3727-4592e530e4ed@web.de> (raw)

> When devm_regmap_init_i2c() returns an error code, a pairing
> runtime PM usage counter decrement is needed to keep the
> counter balanced.

How do you think about to replace the word “pairing” by “corresponding”?


> For error paths after ak8974_set_power(),
> ak8974_detect() and ak8974_reset(), things are the same.

Will an other wording become more helpful than this information?


> However, When iio_triggered_buffer_setup() returns an error
> code, there will be two PM usgae counter decrements.

Please avoid two typos in this sentence.


Would you like to add the tag “Fixes” to the commit message?


…
+++ b/drivers/iio/magnetometer/ak8974.c
…
@@ -854,7 +856,6 @@  static int ak8974_probe(struct i2c_client *i2c,
…

Can a source code variant like the following make sense
for a more complete exception handling?

power_off:
	ak8974_set_power(ak8974, AK8974_PWR_OFF);
put_pm:
	pm_runtime_put_noidle(&i2c->dev);
	pm_runtime_disable(&i2c->dev);
disable_regulator:
	regulator_bulk_disable(ARRAY_SIZE(ak8974->regs), ak8974->regs);
	return ret;


Regards,
Markus

WARNING: multiple messages have this Message-ID (diff)
From: Markus Elfring <Markus.Elfring@web.de>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-iio@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hartmut Knaack <knaack.h@gmx.de>,
	Jonathan Cameron <jic23@kernel.org>, Kangjie Lu <kjlu@umn.edu>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH v2] iio: magnetometer: ak8974: Fix runtime PM imbalance on error in ak8974_probe()
Date: Sun, 31 May 2020 14:06:11 +0000	[thread overview]
Message-ID: <dd84c12f-277d-27e7-3727-4592e530e4ed@web.de> (raw)

> When devm_regmap_init_i2c() returns an error code, a pairing
> runtime PM usage counter decrement is needed to keep the
> counter balanced.

How do you think about to replace the word “pairing” by “corresponding”?


> For error paths after ak8974_set_power(),
> ak8974_detect() and ak8974_reset(), things are the same.

Will an other wording become more helpful than this information?


> However, When iio_triggered_buffer_setup() returns an error
> code, there will be two PM usgae counter decrements.

Please avoid two typos in this sentence.


Would you like to add the tag “Fixes” to the commit message?


…
+++ b/drivers/iio/magnetometer/ak8974.c
…
@@ -854,7 +856,6 @@  static int ak8974_probe(struct i2c_client *i2c,
…

Can a source code variant like the following make sense
for a more complete exception handling?

power_off:
	ak8974_set_power(ak8974, AK8974_PWR_OFF);
put_pm:
	pm_runtime_put_noidle(&i2c->dev);
	pm_runtime_disable(&i2c->dev);
disable_regulator:
	regulator_bulk_disable(ARRAY_SIZE(ak8974->regs), ak8974->regs);
	return ret;


Regards,
Markus

             reply	other threads:[~2020-05-31 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31 14:06 Markus Elfring [this message]
2020-05-31 14:06 ` [PATCH v2] iio: magnetometer: ak8974: Fix runtime PM imbalance on error in ak8974_probe() Markus Elfring
2020-06-25 12:34 ` Markus Elfring
2020-06-25 12:34   ` Markus Elfring
2020-06-27 14:53   ` Jonathan Cameron
2020-06-27 14:53     ` Jonathan Cameron
2020-06-27 15:52     ` [v2] " Markus Elfring
2020-06-27 15:52       ` Markus Elfring

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=dd84c12f-277d-27e7-3727-4592e530e4ed@web.de \
    --to=markus.elfring@web.de \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=jic23@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kjlu@umn.edu \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.