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

Commit aaa6fec6 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: Fix clock scaling's init error checking"

parents b91b588d 053755ed
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -708,6 +708,7 @@ static int mmc_devfreq_create_freq_table(struct mmc_host *host)
int mmc_init_clk_scaling(struct mmc_host *host)
{
	int err;
	struct devfreq *devfreq;

	if (!host || !host->card) {
		pr_err("%s: unexpected host/card parameters\n",
@@ -763,17 +764,20 @@ int mmc_init_clk_scaling(struct mmc_host *host)
		host->clk_scaling.ondemand_gov_data.upthreshold,
		host->clk_scaling.ondemand_gov_data.downdifferential,
		host->clk_scaling.devfreq_profile.polling_ms);
	host->clk_scaling.devfreq = devfreq_add_device(

	devfreq = devfreq_add_device(
		mmc_classdev(host),
		&host->clk_scaling.devfreq_profile,
		"simple_ondemand",
		&host->clk_scaling.ondemand_gov_data);
	if (!host->clk_scaling.devfreq) {

	if (IS_ERR(devfreq)) {
		pr_err("%s: unable to register with devfreq\n",
			mmc_hostname(host));
		return -EPERM;
		return PTR_ERR(devfreq);
	}

	host->clk_scaling.devfreq = devfreq;
	pr_debug("%s: clk scaling is enabled for device %s (%p) with devfreq %p (clock = %uHz)\n",
		mmc_hostname(host),
		dev_name(mmc_classdev(host)),