Skip to content
Commit 46b155ac authored by Xu Yilun's avatar Xu Yilun Committed by Xu Yilun
Browse files

fpga: dfl: destroy/recreate feature platform device on port release/assign



Now that the internal DFL APIs have been converted to consume DFL
enumeration info from a separate structure, dfl_feature_dev_data, which
lifetime is independent of the feature device, proceed to completely
destroy and recreate the feature platform device on port release and
assign, respectively. This resolves a longstanding issue in the use of
platform_device_add(), which states to "not call this routine more than
once for any device structure" and which used to print a kernel warning.

The function feature_dev_unregister() resets the device pointer in the
feature data to NULL to signal that the feature platform device has been
destroyed. This substitutes the previous device_is_registered() checks.

Signed-off-by: default avatarXu Yilun <yilun.xu@intel.com>
Signed-off-by: default avatarRuss Weight <russell.h.weight@intel.com>
Signed-off-by: default avatarPeter Colberg <peter.colberg@intel.com>
Reviewed-by: default avatarMatthew Gerlach <matthew.gerlach@linux.intel.com>
Reviewed-by: default avatarBasheer Ahmed Muddebihal <basheer.ahmed.muddebihal@linux.intel.com>
Acked-by: default avatarXu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20241120011035.230574-19-peter.colberg@intel.com


Signed-off-by: default avatarXu Yilun <yilun.xu@linux.intel.com>
parent ff1f06b6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment