EDAC: Defer wq init until it's used

The EDAC subsystem is compiled into most kernels for obvious
reasons, but even if the target system does not have any EDAC
controller, it generously starts a workqueue named R-edac-poller
at init:

  31 root         0 IW<  [kworker/R-edac-]

This is unnecessary if the kernel boots on a system with no
EDAC controller. Rewrite the code slightly so that the workqueue
is only started when the first work item is actually put on it.

Creating a workqueue will seldom fail, and if it does this early
we are in too deep trouble anyway, so this should work fine.

After this the EDAC workqueue is only created once it is actually
put to use.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 files changed