linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] iio: magnetometer: ak8974: Fix runtime PM imbalance on error in ak8974_probe()
@ 2020-05-31 14:06 Markus Elfring
  2020-06-25 12:34 ` Markus Elfring
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2020-05-31 14:06 UTC (permalink / raw)
  To: Dinghao Liu, Linus Walleij, linux-iio
  Cc: kernel-janitors, linux-kernel, Hartmut Knaack, Jonathan Cameron,
	Kangjie Lu, Lars-Peter Clausen, Peter Meerwald-Stadler

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-27 15:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-27 14:53   ` Jonathan Cameron
2020-06-27 15:52     ` [v2] " Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).