}
/**
- * fpga_region_find - find FPGA region
+ * of_fpga_region_find - find FPGA region
* @np: device node of FPGA Region
+ *
* Caller will need to put_device(®ion->dev) when done.
+ *
* Returns FPGA Region struct or NULL
*/
-static struct fpga_region *fpga_region_find(struct device_node *np)
+static struct fpga_region *of_fpga_region_find(struct device_node *np)
{
struct device *dev;
}
/**
- * fpga_region_get_manager - get reference for FPGA manager
+ * of_fpga_region_get_mgr - get reference for FPGA manager
* @np: device node of FPGA region
*
* Get FPGA Manager from "fpga-mgr" property or from ancestor region.
*
* Return: fpga manager struct or IS_ERR() condition containing error code.
*/
-static struct fpga_manager *fpga_region_get_manager(struct device_node *np)
+static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)
{
struct device_node *mgr_node;
struct fpga_manager *mgr;
}
/**
- * fpga_region_get_bridges - create a list of bridges
+ * of_fpga_region_get_bridges - create a list of bridges
* @region: FPGA region
- * @overlay: device node of the overlay
+ * @info: FPGA image info
*
* Create a list of bridges including the parent bridge and the bridges
* specified by "fpga-bridges" property. Note that the
* Return 0 for success (even if there are no bridges specified)
* or -EBUSY if any of the bridges are in use.
*/
-static int fpga_region_get_bridges(struct fpga_region *region,
- struct device_node *overlay)
+static int of_fpga_region_get_bridges(struct fpga_region *region,
+ struct fpga_image_info *info)
{
struct device *dev = ®ion->dev;
struct device_node *region_np = dev->of_node;
int i, ret;
/* If parent is a bridge, add to list */
- ret = of_fpga_bridge_get_to_list(region_np->parent, region->info,
+ ret = of_fpga_bridge_get_to_list(region_np->parent, info,
®ion->bridge_list);
/* -EBUSY means parent is a bridge that is under use. Give up. */
parent_br = region_np->parent;
/* If overlay has a list of bridges, use it. */
- if (of_parse_phandle(overlay, "fpga-bridges", 0))
- np = overlay;
+ if (of_parse_phandle(info->overlay, "fpga-bridges", 0))
+ np = info->overlay;
else
np = region_np;
goto err_put_region;
}
- ret = fpga_region_get_bridges(region, info->overlay);
+ ret = of_fpga_region_get_bridges(region, info);
if (ret) {
dev_err(dev, "failed to get FPGA bridges\n");
goto err_unlock_mgr;
}
/**
- * fpga_region_notify_pre_apply - pre-apply overlay notification
+ * of_fpga_region_notify_pre_apply - pre-apply overlay notification
*
* @region: FPGA region that the overlay was applied to
* @nd: overlay notification data
*
* Returns 0 for success or negative error code for failure.
*/
-static int fpga_region_notify_pre_apply(struct fpga_region *region,
- struct of_overlay_notify_data *nd)
+static int of_fpga_region_notify_pre_apply(struct fpga_region *region,
+ struct of_overlay_notify_data *nd)
{
struct device *dev = ®ion->dev;
struct fpga_image_info *info;
}
/**
- * fpga_region_notify_post_remove - post-remove overlay notification
+ * of_fpga_region_notify_post_remove - post-remove overlay notification
*
* @region: FPGA region that was targeted by the overlay that was removed
* @nd: overlay notification data
* Called after an overlay has been removed if the overlay's target was a
* FPGA region.
*/
-static void fpga_region_notify_post_remove(struct fpga_region *region,
- struct of_overlay_notify_data *nd)
+static void of_fpga_region_notify_post_remove(struct fpga_region *region,
+ struct of_overlay_notify_data *nd)
{
fpga_bridges_disable(®ion->bridge_list);
fpga_bridges_put(®ion->bridge_list);
return NOTIFY_OK;
}
- region = fpga_region_find(nd->target);
+ region = of_fpga_region_find(nd->target);
if (!region)
return NOTIFY_OK;
ret = 0;
switch (action) {
case OF_OVERLAY_PRE_APPLY:
- ret = fpga_region_notify_pre_apply(region, nd);
+ ret = of_fpga_region_notify_pre_apply(region, nd);
break;
case OF_OVERLAY_POST_REMOVE:
- fpga_region_notify_post_remove(region, nd);
+ of_fpga_region_notify_post_remove(region, nd);
break;
}
.notifier_call = of_fpga_region_notify,
};
-static int fpga_region_probe(struct platform_device *pdev)
+static int of_fpga_region_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct fpga_manager *mgr;
int id, ret = 0;
- mgr = fpga_region_get_manager(np);
+ mgr = of_fpga_region_get_mgr(np);
if (IS_ERR(mgr))
return -EPROBE_DEFER;
return ret;
}
-static int fpga_region_remove(struct platform_device *pdev)
+static int of_fpga_region_remove(struct platform_device *pdev)
{
struct fpga_region *region = platform_get_drvdata(pdev);
return 0;
}
-static struct platform_driver fpga_region_driver = {
- .probe = fpga_region_probe,
- .remove = fpga_region_remove,
+static struct platform_driver of_fpga_region_driver = {
+ .probe = of_fpga_region_probe,
+ .remove = of_fpga_region_remove,
.driver = {
.name = "fpga-region",
.of_match_table = of_match_ptr(fpga_region_of_match),
if (ret)
goto err_class;
- ret = platform_driver_register(&fpga_region_driver);
+ ret = platform_driver_register(&of_fpga_region_driver);
if (ret)
goto err_plat;
static void __exit fpga_region_exit(void)
{
- platform_driver_unregister(&fpga_region_driver);
+ platform_driver_unregister(&of_fpga_region_driver);
of_overlay_notifier_unregister(&fpga_region_of_nb);
class_destroy(fpga_region_class);
ida_destroy(&fpga_region_ida);