Re: [PATCH v2 4/7] power: supply: bq24190_charger: Never reset the charger chip
From: Sebastian Reichel <sre@kernel.org>
Date: 2017-03-23 10:59:51
Attachments
- signature.asc [application/pgp-signature] 833 bytes
From: Sebastian Reichel <sre@kernel.org>
Date: 2017-03-23 10:59:51
Hi, On Wed, Mar 22, 2017 at 11:41:14AM -0700, Liam Breck wrote:
On Wed, Mar 22, 2017 at 7:55 AM, Hans de Goede [off-list ref] wrote:quoted
-static int bq24190_register_reset(struct bq24190_dev_info *bdi) -{ - int ret, limit = 100; - u8 v; - - /* Reset the registers */ - ret = bq24190_write_mask(bdi, BQ24190_REG_POC, - BQ24190_REG_POC_RESET_MASK, - BQ24190_REG_POC_RESET_SHIFT, - 0x1); - if (ret < 0) - return ret; - - /* Reset bit will be cleared by hardware so poll until it is */ - do { - ret = bq24190_read_mask(bdi, BQ24190_REG_POC, - BQ24190_REG_POC_RESET_MASK, - BQ24190_REG_POC_RESET_SHIFT, - &v); - if (ret < 0) - return ret; - - if (!v) - break; - - udelay(10); - } while (--limit); - - if (!limit) - return -EIO; - - return 0; -}Let's leave this in with __maybe_unused.
It's named __maybe_unused instead of __always_unused for a reason. -- Sebastian