Skip to content

Commit 330e393

Browse files
Ulf Hanssonrafaeljw
authored andcommitted
PM: domains: Fix build error for genpd notifiers
The __raw_notifier_call_chain() was recently removed and replaced with raw_notifier_call_chain_robust(). Recent changes to genpd didn't take that into account, which causes a build error. Let's fix this by converting to the raw_notifier_call_chain_robust() in genpd. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Lina Iyer <ilina@codeaurora.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c6a113b commit 330e393

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

drivers/base/power/domain.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,15 @@ static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed)
413413
unsigned int state_idx = genpd->state_idx;
414414
ktime_t time_start;
415415
s64 elapsed_ns;
416-
int ret, nr_calls = 0;
416+
int ret;
417417

418418
/* Notify consumers that we are about to power on. */
419-
ret = __raw_notifier_call_chain(&genpd->power_notifiers,
420-
GENPD_NOTIFY_PRE_ON, NULL, -1,
421-
&nr_calls);
419+
ret = raw_notifier_call_chain_robust(&genpd->power_notifiers,
420+
GENPD_NOTIFY_PRE_ON,
421+
GENPD_NOTIFY_OFF, NULL);
422422
ret = notifier_to_errno(ret);
423423
if (ret)
424-
goto err;
424+
return ret;
425425

426426
if (!genpd->power_on)
427427
goto out;
@@ -462,15 +462,15 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)
462462
unsigned int state_idx = genpd->state_idx;
463463
ktime_t time_start;
464464
s64 elapsed_ns;
465-
int ret, nr_calls = 0;
465+
int ret;
466466

467467
/* Notify consumers that we are about to power off. */
468-
ret = __raw_notifier_call_chain(&genpd->power_notifiers,
469-
GENPD_NOTIFY_PRE_OFF, NULL, -1,
470-
&nr_calls);
468+
ret = raw_notifier_call_chain_robust(&genpd->power_notifiers,
469+
GENPD_NOTIFY_PRE_OFF,
470+
GENPD_NOTIFY_ON, NULL);
471471
ret = notifier_to_errno(ret);
472472
if (ret)
473-
goto busy;
473+
return ret;
474474

475475
if (!genpd->power_off)
476476
goto out;
@@ -502,10 +502,7 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)
502502
NULL);
503503
return 0;
504504
busy:
505-
if (nr_calls)
506-
__raw_notifier_call_chain(&genpd->power_notifiers,
507-
GENPD_NOTIFY_ON, NULL, nr_calls - 1,
508-
NULL);
505+
raw_notifier_call_chain(&genpd->power_notifiers, GENPD_NOTIFY_ON, NULL);
509506
return ret;
510507
}
511508

0 commit comments

Comments
 (0)