hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/fpga/of-fpga-region.c
....@@ -22,11 +22,6 @@
2222 };
2323 MODULE_DEVICE_TABLE(of, fpga_region_of_match);
2424
25
-static int fpga_region_of_node_match(struct device *dev, const void *data)
26
-{
27
- return dev->of_node == data;
28
-}
29
-
3025 /**
3126 * of_fpga_region_find - find FPGA region
3227 * @np: device node of FPGA Region
....@@ -37,7 +32,7 @@
3732 */
3833 static struct fpga_region *of_fpga_region_find(struct device_node *np)
3934 {
40
- return fpga_region_class_find(NULL, np, fpga_region_of_node_match);
35
+ return fpga_region_class_find(NULL, np, device_match_of_node);
4136 }
4237
4338 /**
....@@ -410,7 +405,7 @@
410405 if (IS_ERR(mgr))
411406 return -EPROBE_DEFER;
412407
413
- region = fpga_region_create(dev, mgr, of_fpga_region_get_bridges);
408
+ region = devm_fpga_region_create(dev, mgr, of_fpga_region_get_bridges);
414409 if (!region) {
415410 ret = -ENOMEM;
416411 goto eprobe_mgr_put;
....@@ -418,17 +413,15 @@
418413
419414 ret = fpga_region_register(region);
420415 if (ret)
421
- goto eprobe_free;
416
+ goto eprobe_mgr_put;
422417
423418 of_platform_populate(np, fpga_region_of_match, NULL, &region->dev);
424
- dev_set_drvdata(dev, region);
419
+ platform_set_drvdata(pdev, region);
425420
426421 dev_info(dev, "FPGA Region probed\n");
427422
428423 return 0;
429424
430
-eprobe_free:
431
- fpga_region_free(region);
432425 eprobe_mgr_put:
433426 fpga_mgr_put(mgr);
434427 return ret;