ACPI / PM: Fix error code path for power resources initialization

Commit 781d737 (ACPI: Drop power resources driver) introduced a
bug in the power resources initialization error code path causing
a NULL pointer to be referenced in acpi_release_power_resource()
if there's an error triggering a jump to the 'err' label in
acpi_add_power_resource().  This happens because the list_node
field of struct acpi_power_resource has not been initialized yet
at this point and doing a list_del() on it is a bad idea.

To prevent this problem from occuring, initialize the list_node
field of struct acpi_power_resource upfront.

Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: 3.9+ <stable@vger.kernel.org>
Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
ACPI / LPSS: Power up LPSS devices during enumeration

Commit 7cd8407 (ACPI / PM: Do not execute _PS0 for devices without
_PSC during initialization) introduced a regression on some systems
with Intel Lynxpoint Low-Power Subsystem (LPSS) where some devices
need to be powered up during initialization, but their device objects
in the ACPI namespace have _PS0 and _PS3 only (without _PSC or power
resources).

To work around this problem, make the ACPI LPSS driver power up
devices it knows about by using a new helper function
acpi_device_fix_up_power() that does all of the necessary
sanity checks and calls acpi_dev_pm_explicit_set() to put the
device into D0.

Reported-and-tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Merge branch 'acpi-fixes-next' into linux-next

* acpi-fixes-next:
  ACPI / LPSS: Power up LPSS devices during enumeration
  ACPI / PM: Fix error code path for power resources initialization
  ACPI / dock: Take ACPI scan lock in write_undock()
  ACPI / resources: call acpi_get_override_irq() only for legacy IRQ resources
Merge branch 'acpi-lpss-next' into linux-next

* acpi-lpss-next:
  ACPI / LPSS: override SDIO private register space size from ACPI tables
  ACPI / LPSS: mask the UART TX completion interrupt
  ACPI / LPSS: add support for Intel BayTrail

Conflicts:
	drivers/acpi/acpi_lpss.c
Merge branch 'acpi-assorted-next' into linux-next

* acpi-assorted-next:
  ACPI / EC: Add HP Folio 13 to ec_dmi_table in order to skip DSDT scan
  ACPI: Add CMOS RTC Operation Region handler support
  ACPI: Remove unused flags in acpi_device_flags
  ACPI: Remove useless initializers
  ACPI / battery: Make sure all spaces are in correct places
  ACPI: add _STA evaluation at do_acpi_find_child()
  ACPI / EC: access user space with get_user()/put_user()
Merge branch 'acpica-next' into linux-next

* acpica-next:
  ACPICA: Clear events initialized flag upon event component termination
  ACPICA: Fix possible memory leak in GPE init error path
  ACPICA: ACPICA Termination: Delete global lock pending lock
  ACPICA: Update interface to acpi_ut_valid_acpi_name()
  ACPICA: Do not use extended sleep registers unless HW-reduced bit is set
  ACPICA: Split table print utilities to a new a separate file
  ACPICA: Add option to disable loading of SSDTs from the RSDT/XSDT
  ACPICA: Standardize all switch() blocks
  ACPICA: Split internal error msg routines to a separate file
  ACPICA: Split buffer dump routines into separate file
Merge branch 'acpi-hotplug-next' into linux-next

* acpi-hotplug-next:
  ACPI: Do not use CONFIG_ACPI_HOTPLUG_MEMORY_MODULE
Merge branch 'pm-cpuidle-next' into linux-next

* pm-cpuidle-next:
  cpuidle: Fix ARCH_NEEDS_CPU_IDLE_COUPLED dependency warning
  cpuidle: Comment the driver's framework code
  cpuidle: simplify multiple driver support
  ARM: zynq: Add cpuidle support
  cpuidle: improve governor Kconfig options
Merge branch 'pm-cpufreq-next' into linux-next

* pm-cpufreq-next:
  cpufreq: Simplify userspace governor
  cpufreq: powerpc: move cpufreq driver to drivers/cpufreq
  cpufreq: kirkwood: Select CPU_FREQ_TABLE option
  cpufreq: big.LITTLE needs cpufreq table
  cpufreq: SPEAr needs cpufreq table
  cpufreq: powerpc: Add cpufreq driver for Freescale e500mc SoCs
  cpufreq: remove unnecessary cpufreq_cpu_{get|put}() calls
  cpufreq: MAINTAINERS: Add git tree path for ARM specific updates
  cpufreq: rename index as driver_data in cpufreq_frequency_table
  cpufreq: Don't create empty /sys/devices/system/cpu/cpufreq directory
  cpufreq: Move get_cpu_idle_time() to cpufreq.c
  cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c
  cpufreq: Add EXPORT_SYMBOL_GPL for have_governor_per_policy
  cpufreq: tegra: Don't initialize .index field of cpufreq_frequency_table
Merge branch 'pm-devfreq-next' into linux-next

* pm-devfreq-next:
  MAINTAINERS: update mailing list for devfreq(DVFS).
  PM / devfreq: fix typo "CPU_EXYNOS4.12" twice
  PM / devfreq: fix missing unlock on error in exynos4_busfreq_pm_notifier_event()
  PM / devfreq: add comments and Documentation
  PM / devfreq: account suspend/resume for stats
  PM / devfreq: Add Exynos5-bus devfreq driver for Exynos5250
  PM / devfreq: Move exynos4 devfreq driver into a new sub-directory
Merge branch 'pm-assorted-next' into linux-next

* pm-assorted-next:
  PM / wakeup: Adjust messaging for wake events during suspend
  PM / Runtime: Update .runtime_idle() callback documentation
  PM / Runtime: Rework the "runtime idle" helper routine
  PM / Hibernate: print physical addresses consistently with other parts of kernel
Merge branch 'pm-omap-next' into linux-next

* pm-omap-next:
  PM / AVS: SmartReflex: use devm_* API to initialize SmartReflex
  PM / AVS: SmartReflex: use omap_sr * for enable/disable interface
  PM / AVS: SmartReflex: use omap_sr * for minmax interfaces
  PM / AVS: SmartReflex: use omap_sr * for errgen interfaces
  PM / AVS: SmartReflex: fix driver name
  PM / AVS: SmartReflex: disable runtime PM on driver remove
  PM / AVS: SmartReflex: disable errgen before vpbound disable