Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e09b0d4e authored by Ulf Hansson's avatar Ulf Hansson Committed by Rafael J. Wysocki
Browse files

i2c: core: Convert to dev_pm_domain_attach|detach()



Previously only the ACPI PM domain was supported by the i2c bus.

Let's convert to the common attach/detach functions for PM domains,
which currently means we are extending the support to include the
generic PM domain as well.

Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Reviewed-by: default avatarKevin Hilman <khilman@linaro.org>
Acked-by: default avatarWolfram Sang <wsa@the-dreams.de>
Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent cb518413
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -279,10 +279,13 @@ static int i2c_device_probe(struct device *dev)
	if (status < 0)
	if (status < 0)
		return status;
		return status;


	acpi_dev_pm_attach(&client->dev, true);
	status = dev_pm_domain_attach(&client->dev, true);
	status = driver->probe(client, i2c_match_id(driver->id_table, client));
	if (status != -EPROBE_DEFER) {
		status = driver->probe(client, i2c_match_id(driver->id_table,
					client));
		if (status)
		if (status)
		acpi_dev_pm_detach(&client->dev, true);
			dev_pm_domain_detach(&client->dev, true);
	}


	return status;
	return status;
}
}
@@ -302,7 +305,7 @@ static int i2c_device_remove(struct device *dev)
		status = driver->remove(client);
		status = driver->remove(client);
	}
	}


	acpi_dev_pm_detach(&client->dev, true);
	dev_pm_domain_detach(&client->dev, true);
	return status;
	return status;
}
}