diff options
Diffstat (limited to 'drivers/fpga/of-fpga-region.c')
| -rw-r--r-- | drivers/fpga/of-fpga-region.c | 42 | 
1 files changed, 20 insertions, 22 deletions
| diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c index e405309baadc..ae82532fc127 100644 --- a/drivers/fpga/of-fpga-region.c +++ b/drivers/fpga/of-fpga-region.c @@ -28,7 +28,7 @@ MODULE_DEVICE_TABLE(of, fpga_region_of_match);   *   * Caller will need to put_device(®ion->dev) when done.   * - * Returns FPGA Region struct or NULL + * Return: FPGA Region struct or NULL   */  static struct fpga_region *of_fpga_region_find(struct device_node *np)  { @@ -80,7 +80,7 @@ static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)   * Caller should call fpga_bridges_put(®ion->bridge_list) when   * done with the bridges.   * - * Return 0 for success (even if there are no bridges specified) + * Return: 0 for success (even if there are no bridges specified)   * or -EBUSY if any of the bridges are in use.   */  static int of_fpga_region_get_bridges(struct fpga_region *region) @@ -139,13 +139,13 @@ static int of_fpga_region_get_bridges(struct fpga_region *region)  }  /** - * child_regions_with_firmware + * child_regions_with_firmware - Used to check the child region info.   * @overlay: device node of the overlay   *   * If the overlay adds child FPGA regions, they are not allowed to have   * firmware-name property.   * - * Return 0 for OK or -EINVAL if child FPGA region adds firmware-name. + * Return: 0 for OK or -EINVAL if child FPGA region adds firmware-name.   */  static int child_regions_with_firmware(struct device_node *overlay)  { @@ -181,17 +181,17 @@ static int child_regions_with_firmware(struct device_node *overlay)   * @region: FPGA region   * @overlay: overlay applied to the FPGA region   * - * Given an overlay applied to a FPGA region, parse the FPGA image specific + * Given an overlay applied to an FPGA region, parse the FPGA image specific   * info in the overlay and do some checking.   * - * Returns: + * Return:   *   NULL if overlay doesn't direct us to program the FPGA.   *   fpga_image_info struct if there is an image to program.   *   error code for invalid overlay.   */ -static struct fpga_image_info *of_fpga_region_parse_ov( -						struct fpga_region *region, -						struct device_node *overlay) +static struct fpga_image_info * +of_fpga_region_parse_ov(struct fpga_region *region, +			struct device_node *overlay)  {  	struct device *dev = ®ion->dev;  	struct fpga_image_info *info; @@ -273,13 +273,13 @@ ret_no_info:   * @region: FPGA region that the overlay was applied to   * @nd: overlay notification data   * - * Called when an overlay targeted to a FPGA Region is about to be applied. + * Called when an overlay targeted to an FPGA Region is about to be applied.   * Parses the overlay for properties that influence how the FPGA will be   * programmed and does some checking. If the checks pass, programs the FPGA.   * If the checks fail, overlay is rejected and does not get added to the   * live tree.   * - * Returns 0 for success or negative error code for failure. + * Return: 0 for success or negative error code for failure.   */  static int of_fpga_region_notify_pre_apply(struct fpga_region *region,  					   struct of_overlay_notify_data *nd) @@ -336,10 +336,10 @@ static void of_fpga_region_notify_post_remove(struct fpga_region *region,   * @action:	notifier action   * @arg:	reconfig data   * - * This notifier handles programming a FPGA when a "firmware-name" property is - * added to a fpga-region. + * This notifier handles programming an FPGA when a "firmware-name" property is + * added to an fpga-region.   * - * Returns NOTIFY_OK or error if FPGA programming fails. + * Return: NOTIFY_OK or error if FPGA programming fails.   */  static int of_fpga_region_notify(struct notifier_block *nb,  				 unsigned long action, void *arg) @@ -405,16 +405,12 @@ static int of_fpga_region_probe(struct platform_device *pdev)  	if (IS_ERR(mgr))  		return -EPROBE_DEFER; -	region = devm_fpga_region_create(dev, mgr, of_fpga_region_get_bridges); -	if (!region) { -		ret = -ENOMEM; +	region = fpga_region_register(dev, mgr, of_fpga_region_get_bridges); +	if (IS_ERR(region)) { +		ret = PTR_ERR(region);  		goto eprobe_mgr_put;  	} -	ret = fpga_region_register(region); -	if (ret) -		goto eprobe_mgr_put; -  	of_platform_populate(np, fpga_region_of_match, NULL, ®ion->dev);  	platform_set_drvdata(pdev, region); @@ -448,8 +444,10 @@ static struct platform_driver of_fpga_region_driver = {  };  /** - * fpga_region_init - init function for fpga_region class + * of_fpga_region_init - init function for fpga_region class   * Creates the fpga_region class and registers a reconfig notifier. + * + * Return: 0 on success, negative error code otherwise.   */  static int __init of_fpga_region_init(void)  { | 
