Re: [PATCH v1] misc: eeprom: at24: support pm_runtime control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bibby,

On 9/2/19 11:32 AM, Bibby Hsieh wrote:
...
+	pm_runtime_get_sync(dev);
+	if (at24->has_supplies) {
+		err = regulator_bulk_enable(AT24_NUM_SUPPLIES, at24->supplies);
+		if (err) {
+			dev_err(dev, "Failed to enable power regulators\n");
+			return err;
+		}
+	} >
  	/*
  	 * Perform a one-byte test read to verify that the
  	 * chip is functional.
  	 */
  	err = at24_read(at24, 0, &test_byte, 1);
-	pm_runtime_idle(dev);
+	pm_runtime_put(dev);
  	if (err) {
  		pm_runtime_disable(dev);

Should there be corresponding regulator_bulk_disable in the error path here and below?

  		return -ENODEV;
@@ -726,15 +752,46 @@ static int at24_probe(struct i2c_client *client)
static int at24_remove(struct i2c_client *client)
  {
+	struct at24_data *at24 = i2c_get_clientdata(client);
+
  	pm_runtime_disable(&client->dev);
  	pm_runtime_set_suspended(&client->dev);
+	if (at24->has_supplies)
+		regulator_bulk_disable(AT24_NUM_SUPPLIES, at24->supplies);
return 0;
  } > ...



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux