Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: imu: inv_icm42600: Avoid configuring if already pm_runtime suspended

Do as in suspend, skip resume configuration steps if the device is already
pm_runtime suspended. This avoids reconfiguring a device that is already
in the correct low-power state and ensures that pm_runtime handles the
power state transitions properly.

Fixes: 31c24c1e93c3 ("iio: imu: inv_icm42600: add core of new inv_icm42600 driver")
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Link: https://patch.msgid.link/20250901-icm42pmreg-v3-3-ef1336246960@geanix.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Sean Nyekjaer and committed by
Jonathan Cameron
466f7a2f a95a0b4e

+6 -5
+6 -5
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
··· 837 837 struct device *accel_dev; 838 838 bool wakeup; 839 839 int accel_conf; 840 - int ret; 840 + int ret = 0; 841 841 842 842 mutex_lock(&st->lock); 843 843 844 844 st->suspended.gyro = st->conf.gyro.mode; 845 845 st->suspended.accel = st->conf.accel.mode; 846 846 st->suspended.temp = st->conf.temp_en; 847 - if (pm_runtime_suspended(dev)) { 848 - ret = 0; 847 + if (pm_runtime_suspended(dev)) 849 848 goto out_unlock; 850 - } 851 849 852 850 /* disable FIFO data streaming */ 853 851 if (st->fifo.on) { ··· 898 900 struct inv_icm42600_sensor_state *accel_st = iio_priv(st->indio_accel); 899 901 struct device *accel_dev; 900 902 bool wakeup; 901 - int ret; 903 + int ret = 0; 902 904 903 905 mutex_lock(&st->lock); 906 + 907 + if (pm_runtime_suspended(dev)) 908 + goto out_unlock; 904 909 905 910 /* check wakeup capability */ 906 911 accel_dev = &st->indio_accel->dev;