]> www.infradead.org Git - users/hch/misc.git/commitdiff
i2c: Remove redundant pm_runtime_mark_last_busy() calls
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 4 Jul 2025 07:54:15 +0000 (10:54 +0300)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 14 Oct 2025 11:51:07 +0000 (13:51 +0200)
pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
22 files changed:
drivers/i2c/busses/i2c-amd-mp2.h
drivers/i2c/busses/i2c-at91-core.c
drivers/i2c/busses/i2c-at91-master.c
drivers/i2c/busses/i2c-cadence.c
drivers/i2c/busses/i2c-davinci.c
drivers/i2c/busses/i2c-designware-master.c
drivers/i2c/busses/i2c-hix5hd2.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-img-scb.c
drivers/i2c/busses/i2c-imx-lpi2c.c
drivers/i2c/busses/i2c-imx.c
drivers/i2c/busses/i2c-mv64xxx.c
drivers/i2c/busses/i2c-nvidia-gpu.c
drivers/i2c/busses/i2c-omap.c
drivers/i2c/busses/i2c-qcom-cci.c
drivers/i2c/busses/i2c-qcom-geni.c
drivers/i2c/busses/i2c-qup.c
drivers/i2c/busses/i2c-riic.c
drivers/i2c/busses/i2c-rzv2m.c
drivers/i2c/busses/i2c-sprd.c
drivers/i2c/busses/i2c-stm32f7.c
drivers/i2c/busses/i2c-xiic.c

index 018a42de8b1e3c53ea17ce0dcc38be98bb3b6b92..9b7e9494dd1239b56093df5e5f82a6768649312f 100644 (file)
@@ -207,7 +207,6 @@ static inline void amd_mp2_pm_runtime_get(struct amd_mp2_dev *mp2_dev)
 
 static inline void amd_mp2_pm_runtime_put(struct amd_mp2_dev *mp2_dev)
 {
-       pm_runtime_mark_last_busy(&mp2_dev->pci_dev->dev);
        pm_runtime_put_autosuspend(&mp2_dev->pci_dev->dev);
 }
 
index edc047e3e535c8ca9ce67c000a755a2e8827cc3c..b64adef778d4b85c7c14a2172d43bb7f1a1f3f39 100644 (file)
@@ -313,7 +313,6 @@ static int __maybe_unused at91_twi_resume_noirq(struct device *dev)
                        return ret;
        }
 
-       pm_runtime_mark_last_busy(dev);
        pm_request_autosuspend(dev);
 
        at91_init_twi_bus(twi_dev);
index 59795c1c24ffde60cdfd3dd31ded9b096fc568b4..894cedbca99f57859fc9d412196603a7d686e168 100644 (file)
@@ -717,7 +717,6 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num)
 
        ret = (ret < 0) ? ret : num;
 out:
-       pm_runtime_mark_last_busy(dev->dev);
        pm_runtime_put_autosuspend(dev->dev);
 
        return ret;
index 697d095afbe498d96d61a94883c7a9c8690a8c4c..0fb728ade92e4ebdfbfa39bc9c0f1cc74173ee50 100644 (file)
@@ -1128,7 +1128,6 @@ out:
                cdns_i2c_set_mode(CDNS_I2C_MODE_SLAVE, id);
 #endif
 
-       pm_runtime_mark_last_busy(id->dev);
        pm_runtime_put_autosuspend(id->dev);
        return ret;
 }
index 6a3d4e9e07f45ecc228943e877cde1fd9d72e8cb..a773ba0823214dd0205870a037df00392207feee 100644 (file)
@@ -543,7 +543,6 @@ i2c_davinci_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
        ret = num;
 
 out:
-       pm_runtime_mark_last_busy(dev->dev);
        pm_runtime_put_autosuspend(dev->dev);
 
        return ret;
@@ -821,7 +820,6 @@ static int davinci_i2c_probe(struct platform_device *pdev)
        if (r)
                goto err_unuse_clocks;
 
-       pm_runtime_mark_last_busy(dev->dev);
        pm_runtime_put_autosuspend(dev->dev);
 
        return 0;
index c7a72c28786c2b59a249a768d43a7954119bc018..41e9b5ecad2013bc8fefdb490ed4f6a3dc513fd0 100644 (file)
@@ -901,7 +901,6 @@ done:
        i2c_dw_release_lock(dev);
 
 done_nolock:
-       pm_runtime_mark_last_busy(dev->dev);
        pm_runtime_put_autosuspend(dev->dev);
 
        return ret;
index 5358f5ddf924b84e9e954b6698fd4e30ce2b60b0..95ab910b80c0e2592ced234eee5ebce6bcac6a60 100644 (file)
@@ -373,7 +373,6 @@ static int hix5hd2_i2c_xfer(struct i2c_adapter *adap,
        ret = num;
 
 out:
-       pm_runtime_mark_last_busy(priv->dev);
        pm_runtime_put_autosuspend(priv->dev);
        return ret;
 }
index cba992fa655791d2cf3852fa4bb82e2bcb1c6bc1..57fbec1259beaba3068aa452ca6a736a5e04134a 100644 (file)
@@ -930,7 +930,6 @@ out:
         */
        iowrite8(SMBHSTSTS_INUSE_STS | STATUS_FLAGS, SMBHSTSTS(priv));
 
-       pm_runtime_mark_last_busy(&priv->pci_dev->dev);
        pm_runtime_put_autosuspend(&priv->pci_dev->dev);
        return ret;
 }
index a454f9f251461038405ff931b494a191a7501746..88192c25c44cda317f66781dc66a7ec5b27b5793 100644 (file)
@@ -1131,7 +1131,6 @@ static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
                        break;
        }
 
-       pm_runtime_mark_last_busy(adap->dev.parent);
        pm_runtime_put_autosuspend(adap->dev.parent);
 
        return i2c->msg_status ? i2c->msg_status : num;
@@ -1165,7 +1164,6 @@ static int img_i2c_init(struct img_i2c *i2c)
                         "Unknown hardware revision (%d.%d.%d.%d)\n",
                         (rev >> 24) & 0xff, (rev >> 16) & 0xff,
                         (rev >> 8) & 0xff, rev & 0xff);
-               pm_runtime_mark_last_busy(i2c->adap.dev.parent);
                pm_runtime_put_autosuspend(i2c->adap.dev.parent);
                return -EINVAL;
        }
@@ -1317,7 +1315,6 @@ static int img_i2c_init(struct img_i2c *i2c)
        /* Perform a synchronous sequence to reset the bus */
        ret = img_i2c_reset_bus(i2c);
 
-       pm_runtime_mark_last_busy(i2c->adap.dev.parent);
        pm_runtime_put_autosuspend(i2c->adap.dev.parent);
 
        return ret;
index 03b5a7e8c361abe1d75fb4d31f9614bbc6387d93..2a0962a0b441754577c15ef3a67a7640d41785cc 100644 (file)
@@ -363,7 +363,6 @@ static int lpi2c_imx_master_enable(struct lpi2c_imx_struct *lpi2c_imx)
        return 0;
 
 rpm_put:
-       pm_runtime_mark_last_busy(lpi2c_imx->adapter.dev.parent);
        pm_runtime_put_autosuspend(lpi2c_imx->adapter.dev.parent);
 
        return ret;
@@ -377,7 +376,6 @@ static int lpi2c_imx_master_disable(struct lpi2c_imx_struct *lpi2c_imx)
        temp &= ~MCR_MEN;
        writel(temp, lpi2c_imx->base + LPI2C_MCR);
 
-       pm_runtime_mark_last_busy(lpi2c_imx->adapter.dev.parent);
        pm_runtime_put_autosuspend(lpi2c_imx->adapter.dev.parent);
 
        return 0;
@@ -1462,7 +1460,6 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
        if (ret)
                goto rpm_disable;
 
-       pm_runtime_mark_last_busy(&pdev->dev);
        pm_runtime_put_autosuspend(&pdev->dev);
 
        dev_info(&lpi2c_imx->adapter.dev, "LPI2C adapter registered\n");
@@ -1564,7 +1561,6 @@ static int lpi2c_suspend(struct device *dev)
 
 static int lpi2c_resume(struct device *dev)
 {
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return 0;
index 60f5c790ad7c9f13b4e51af5090d869bace933a4..dcce882f3ebaaf1771e26478d666ab9a9bf2d68a 100644 (file)
@@ -1637,7 +1637,6 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
 
        result = i2c_imx_xfer_common(adapter, msgs, num, false);
 
-       pm_runtime_mark_last_busy(i2c_imx->adapter.dev.parent);
        pm_runtime_put_autosuspend(i2c_imx->adapter.dev.parent);
 
        return result;
@@ -1822,7 +1821,6 @@ static int i2c_imx_probe(struct platform_device *pdev)
        if (ret < 0)
                goto clk_notifier_unregister;
 
-       pm_runtime_mark_last_busy(&pdev->dev);
        pm_runtime_put_autosuspend(&pdev->dev);
 
        dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
@@ -1928,7 +1926,6 @@ static int i2c_imx_suspend(struct device *dev)
 
 static int i2c_imx_resume(struct device *dev)
 {
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return 0;
index 8fc26a5113203f2dbbe63441589a9654bdfc59ef..1acba628e16c3bd1dbf82c777162870cbe3815ef 100644 (file)
@@ -766,7 +766,6 @@ mv64xxx_i2c_xfer_core(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
        drv_data->num_msgs = 0;
        drv_data->msgs = NULL;
 
-       pm_runtime_mark_last_busy(&adap->dev);
        pm_runtime_put_autosuspend(&adap->dev);
 
        return ret;
index 541d808d62d0d51d889d82e132f2cd41890273a1..14c059b0394574cb6fcac37154b4c420761954a3 100644 (file)
@@ -216,7 +216,6 @@ exit:
                if (status2 < 0)
                        dev_err(i2cd->dev, "i2c stop failed %d\n", status2);
        }
-       pm_runtime_mark_last_busy(i2cd->dev);
        pm_runtime_put_autosuspend(i2cd->dev);
        return status;
 }
index 5fcc9f6c33e5b236819c176fa2cf1c5631261e1b..d9f590f0c384340dd31308bdf9ed0cb1a1a2ba8b 100644 (file)
@@ -828,7 +828,6 @@ omap_i2c_xfer_common(struct i2c_adapter *adap, struct i2c_msg msgs[], int num,
                omap->set_mpu_wkup_lat(omap->dev, -1);
 
 out:
-       pm_runtime_mark_last_busy(omap->dev);
        pm_runtime_put_autosuspend(omap->dev);
        return r;
 }
@@ -1510,7 +1509,6 @@ omap_i2c_probe(struct platform_device *pdev)
        dev_info(omap->dev, "bus %d rev%d.%d at %d kHz\n", adap->nr,
                 major, minor, omap->speed);
 
-       pm_runtime_mark_last_busy(omap->dev);
        pm_runtime_put_autosuspend(omap->dev);
 
        return 0;
@@ -1605,7 +1603,6 @@ static int omap_i2c_suspend(struct device *dev)
 
 static int omap_i2c_resume(struct device *dev)
 {
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return 0;
index a3afa11a71a10dbb720ee9acb566991fe55b98a0..e631d79baf1405ee25837690983ec0bd824a1a7b 100644 (file)
@@ -450,7 +450,6 @@ static int cci_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
                ret = num;
 
 err:
-       pm_runtime_mark_last_busy(cci->dev);
        pm_runtime_put_autosuspend(cci->dev);
 
        return ret;
@@ -508,7 +507,6 @@ static int __maybe_unused cci_suspend(struct device *dev)
 static int __maybe_unused cci_resume(struct device *dev)
 {
        cci_resume_runtime(dev);
-       pm_runtime_mark_last_busy(dev);
        pm_request_autosuspend(dev);
 
        return 0;
index 95a577764d5c010777b814d5094f16eb8b673bce..43fdd89b8bebc8996cdf2778c0f9572740e29714 100644 (file)
@@ -714,7 +714,6 @@ static int geni_i2c_xfer(struct i2c_adapter *adap,
        else
                ret = geni_i2c_fifo_xfer(gi2c, msgs, num);
 
-       pm_runtime_mark_last_busy(gi2c->se.dev);
        pm_runtime_put_autosuspend(gi2c->se.dev);
        gi2c->cur = NULL;
        gi2c->err = 0;
index fc348924d52254f70628f60acb104050b4845c3b..a0e076fc5f36375038847dde64cccae2dbb5f20f 100644 (file)
@@ -1139,7 +1139,6 @@ static int qup_i2c_xfer(struct i2c_adapter *adap,
                ret = num;
 out:
 
-       pm_runtime_mark_last_busy(qup->dev);
        pm_runtime_put_autosuspend(qup->dev);
 
        return ret;
@@ -1624,7 +1623,6 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap,
        if (ret == 0)
                ret = num;
 out:
-       pm_runtime_mark_last_busy(qup->dev);
        pm_runtime_put_autosuspend(qup->dev);
 
        return ret;
@@ -1991,7 +1989,6 @@ static int qup_i2c_suspend(struct device *device)
 static int qup_i2c_resume(struct device *device)
 {
        qup_i2c_pm_resume_runtime(device);
-       pm_runtime_mark_last_busy(device);
        pm_request_autosuspend(device);
        return 0;
 }
index b0ee9ac45a976dccd929305b51beb008a6c45ad5..3e8f126cb7f74967ec26d9cd53665cbeeb7093b5 100644 (file)
@@ -206,7 +206,6 @@ static int riic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
        }
 
  out:
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return riic->err ?: num;
@@ -452,7 +451,6 @@ static int riic_init_hw(struct riic_dev *riic)
 
        riic_clear_set_bit(riic, ICCR1_IICRST, 0, RIIC_ICCR1);
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
        return 0;
 }
index b0e9c0b624292c7af4b7a6d3ee0e0978657c65c2..2387148506736a65378809971bfbddfb436b6c4d 100644 (file)
@@ -372,7 +372,6 @@ static int rzv2m_i2c_xfer(struct i2c_adapter *adap,
        ret = num;
 
 out:
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return ret;
index 26ec34b19ad51a2fd53ee4510e8af62d6887b469..1b490525d8dd12e72a814e52371f74a552297a61 100644 (file)
@@ -302,7 +302,6 @@ static int sprd_i2c_xfer(struct i2c_adapter *i2c_adap,
        ret = sprd_i2c_handle_msg(i2c_adap, &msgs[im++], 1);
 
 err_msg:
-       pm_runtime_mark_last_busy(i2c_dev->dev);
        pm_runtime_put_autosuspend(i2c_dev->dev);
 
        return ret < 0 ? ret : im;
@@ -559,7 +558,6 @@ static int sprd_i2c_probe(struct platform_device *pdev)
                goto err_rpm_put;
        }
 
-       pm_runtime_mark_last_busy(i2c_dev->dev);
        pm_runtime_put_autosuspend(i2c_dev->dev);
        return 0;
 
index e6815f6cae787ae70ccfda3f8cf00153d46563c6..dc69ed934ec88e52621e89cbc4d6f2514d7c6bf0 100644 (file)
@@ -1761,7 +1761,6 @@ static int stm32f7_i2c_xfer_core(struct i2c_adapter *i2c_adap,
        }
 
 pm_free:
-       pm_runtime_mark_last_busy(i2c_dev->dev);
        pm_runtime_put_autosuspend(i2c_dev->dev);
 
        return (ret < 0) ? ret : num;
@@ -1870,7 +1869,6 @@ static int stm32f7_i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
        }
 
 pm_free:
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
        return ret;
 }
@@ -1977,7 +1975,6 @@ pm_free:
        if (!stm32f7_i2c_is_slave_registered(i2c_dev))
                stm32f7_i2c_enable_wakeup(i2c_dev, false);
 
-       pm_runtime_mark_last_busy(dev);
        pm_runtime_put_autosuspend(dev);
 
        return ret;
@@ -2015,7 +2012,6 @@ static int stm32f7_i2c_unreg_slave(struct i2c_client *slave)
                stm32f7_i2c_enable_wakeup(i2c_dev, false);
        }
 
-       pm_runtime_mark_last_busy(i2c_dev->dev);
        pm_runtime_put_autosuspend(i2c_dev->dev);
 
        return 0;
@@ -2328,7 +2324,6 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
 
        dev_info(i2c_dev->dev, "STM32F7 I2C-%d bus adapter\n", adap->nr);
 
-       pm_runtime_mark_last_busy(i2c_dev->dev);
        pm_runtime_put_autosuspend(i2c_dev->dev);
 
        return 0;
index 607026c921d68d9a16541ce49cf8bee93739e371..28015d77599d1d3a70951ed0b05ff7041603e51f 100644 (file)
@@ -1349,7 +1349,6 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
        mutex_unlock(&i2c->lock);
 
 out:
-       pm_runtime_mark_last_busy(i2c->dev);
        pm_runtime_put_autosuspend(i2c->dev);
        return err;
 }