diff options
author | Peter Colberg <peter.colberg@intel.com> | 2024-11-19 20:10:29 -0500 |
---|---|---|
committer | Xu Yilun <yilun.xu@linux.intel.com> | 2024-12-18 22:28:48 +0800 |
commit | 3ddcf99119603b102e19e5f44338c1524cc549b7 (patch) | |
tree | 484b101d77d09d725f3d9949e65122f2d3f402c7 /drivers/fpga/dfl.c | |
parent | 7b15c41110382ccc208a046932c762bcca16b5b1 (diff) |
fpga: dfl: store platform device name in feature device data
Add a new member, pdev_name, to the structure dfl_feature_dev_data that
holds the platform device name for convenience. A subsequent commit will
completely destroy the platform device during port release, after which
fdata->dev is unavailable, while fdata itself remains available.
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Reviewed-by: Basheer Ahmed Muddebihal <basheer.ahmed.muddebihal@linux.intel.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20241120011035.230574-14-peter.colberg@intel.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Diffstat (limited to 'drivers/fpga/dfl.c')
-rw-r--r-- | drivers/fpga/dfl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c index 143c5b479789..bd6ca3e0beb1 100644 --- a/drivers/fpga/dfl.c +++ b/drivers/fpga/dfl.c @@ -160,7 +160,7 @@ struct dfl_fpga_port_ops *dfl_fpga_port_ops_get(struct dfl_feature_dev_data *fda list_for_each_entry(ops, &dfl_port_ops_list, node) { /* match port_ops using the name of platform device */ - if (!strcmp(fdata->dev->name, ops->name)) { + if (!strcmp(fdata->pdev_name, ops->name)) { if (!try_module_get(ops->owner)) ops = NULL; goto done; @@ -768,6 +768,7 @@ binfo_create_feature_dev_data(struct build_feature_devs_info *binfo) fdata->dev = fdev; fdata->type = type; + fdata->pdev_name = dfl_devs[type].name; fdata->num = binfo->feature_num; fdata->dfl_cdev = binfo->cdev; fdata->id = FEATURE_DEV_ID_UNUSED; |