Skip to content

Commit

Permalink
fpga: dfl: reset the device pointer of each sub feature
Browse files Browse the repository at this point in the history
In the functions feature_dev_register() and feature_dev_unregister(),
reset the device pointer of each sub feature to NULL for consistency.

Link: https://patchwork.kernel.org/project/linux-fpga/patch/20241120011035.230574-16-peter.colberg@intel.com/
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
  • Loading branch information
pcolberg committed Nov 20, 2024
1 parent 6e26c62 commit d6bf446
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/fpga/dfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,15 +973,25 @@ static int feature_dev_register(struct dfl_feature_dev_data *fdata)

err_put_dev:
platform_device_put(fdev);

fdata->dev = NULL;

dfl_fpga_dev_for_each_feature(fdata, feature)
feature->dev = NULL;

return ret;
}

static void feature_dev_unregister(struct dfl_feature_dev_data *fdata)
{
struct dfl_feature *feature;

platform_device_unregister(fdata->dev);

fdata->dev = NULL;

dfl_fpga_dev_for_each_feature(fdata, feature)
feature->dev = NULL;
}

static int build_info_commit_dev(struct build_feature_devs_info *binfo)
Expand Down

0 comments on commit d6bf446

Please sign in to comment.