drm/i915/bios: store child devices in a list
authorJani Nikula <jani.nikula@intel.com>
Fri, 8 Nov 2019 15:39:49 +0000 (17:39 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 12 Nov 2019 15:35:41 +0000 (17:35 +0200)
commit0d9ef19bddc88ec06ea1e32f0dda25cb82063386
tree76085d1f01b6dd83efd7022d22ef07ec2f322276
parent7a0073d662db8712b1bc1dff2e430725dd9ceff8
drm/i915/bios: store child devices in a list

Using the array is getting clumsy. Make things a bit more dynamic.

Remove early returns on not having child devices when the end result
after "iterating" the empty list would be the same.

v3:
- use list_add_tail to not reverse the child device list (Ville)

v2:
- stick to previous naming of child devices (Ville)
- use kzalloc, handle failure
- initialize list head earlier to keep intel_bios_driver_remove() safe

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/3e72da0b412354ed8be6719df55b0e0cc4caa61a.1573227240.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_bios.c
drivers/gpu/drm/i915/i915_drv.h