Skip to content

Commit

Permalink
fpga: dfl: fme: fix regression querying platform device in power_hwmo…
Browse files Browse the repository at this point in the history
…n_write()

The function power_hwmon_write() receives a hwmon device created with
devm_hwmon_device_register_with_info(). Its parent device is the
platform device, i.e., dfl-fme.X device. The platform device is passed
to to_dfl_feature_dev_data(), which queries the associated platform
data to retrieve the feature device data.

The FME power management feature was available on Intel(R) Xeon(R) CPU
with Integrated FPGAs, which were capable of drawing more power than the
socket could deliver. Discrete FPGA cards do not expose this feature.

Fixes: 43adaa2 ("fpga: dfl: fix the kernel warning when release/assign ports for SRIOV")
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
  • Loading branch information
pcolberg committed Jun 17, 2024
1 parent 276007e commit a98607b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/fpga/dfl-fme-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ static int power_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
static int power_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val)
{
struct dfl_feature_dev_data *fdata = to_dfl_feature_dev_data(dev);
struct dfl_feature_dev_data *fdata = to_dfl_feature_dev_data(dev->parent);
struct dfl_feature *feature = dev_get_drvdata(dev);
int ret = 0;
u64 v;
Expand Down

0 comments on commit a98607b

Please sign in to comment.