Re: [PATCH v7 1/3] iio: magnetometer: bmc150_magn: use automated cleanup for mutex

From: Neel Bullywon

Date: Fri Feb 20 2026 - 14:29:13 EST


I don't have the BMC150 hardware unfortunately, so I can't test runtime PM behavior changes directly.

For the v8 of patch 1, I see two approaches based on the feedback given:

Andy's suggestion: add a bmc150_magn_set_power_mode_locked() helper to deduplicate the lock+call pattern in remove, runtime_suspend, suspend, and resume.
Your suggestion: move the guard() unconditionally into bmc150_magn_set_power_mode() itself, which is cleaner but touches the runtime PM locking that you flagged as suspicious.
Given I can't test runtime PM, would you prefer I go with Andy's suggestion for now, and leave the deeper runtime PM cleanup for a separate series if someone with hardware can verify it?

Or if you'd rather I take a shot at yours with the read_raw() rework you described, I'm happy to do that — just would need someone to test it.