diff options
author | Minghao Chi <[email protected]> | 2022-03-15 02:34:12 +0000 |
---|---|---|
committer | Guenter Roeck <[email protected]> | 2022-03-15 16:30:56 -0700 |
commit | fd6ca3f5b80f6dda381fe84211be3b491f28bf0f (patch) | |
tree | 3bb3988517d007d728aa57e682214697415ec444 | |
parent | 5d4a2ea96b79e7e11f1551130bb9166258b71243 (diff) |
hwmon: (scpi-hwmon): Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Minghao Chi <[email protected]>
Reviewed-by: Jean Delvare <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
-rw-r--r-- | drivers/hwmon/scpi-hwmon.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c index 919877970ae3..5187c6dd5a4f 100644 --- a/drivers/hwmon/scpi-hwmon.c +++ b/drivers/hwmon/scpi-hwmon.c @@ -141,7 +141,6 @@ static int scpi_hwmon_probe(struct platform_device *pdev) struct scpi_ops *scpi_ops; struct device *hwdev, *dev = &pdev->dev; struct scpi_sensors *scpi_sensors; - const struct of_device_id *of_id; int idx, ret; scpi_ops = get_scpi_ops(); @@ -171,12 +170,11 @@ static int scpi_hwmon_probe(struct platform_device *pdev) scpi_sensors->scpi_ops = scpi_ops; - of_id = of_match_device(scpi_of_match, &pdev->dev); - if (!of_id) { + scale = of_device_get_match_data(&pdev->dev); + if (!scale) { dev_err(&pdev->dev, "Unable to initialize scpi-hwmon data\n"); return -ENODEV; } - scale = of_id->data; for (i = 0, idx = 0; i < nr_sensors; i++) { struct sensor_data *sensor = &scpi_sensors->data[idx]; |