linux/drivers/fpga/of-fpga-region.c
/**
 * 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.
 *
 * Caller should call fpga_mgr_put() when done with manager.
 *
 * Return: fpga manager struct or IS_ERR() condition containing error code.
 */
get reference for FPGA manager
@np: device node of FPGA region

Get FPGA Manager from "fpga-mgr" property or from ancestor region.

Caller should call fpga_mgr_put() when done with manager.

fpga manager struct or IS_ERR() condition containing error code.
get reference for FPGA manager @np : device node of FPGA region Get FPGA Manager from " fpga - mgr " property or from ancestor region . Caller should call fpga_mgr_put () when done with manager . fpga manager struct or IS_ERR () condition containing error code .
static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)
{
	struct device_node  *mgr_node;
	struct fpga_manager *mgr;
	of_node_get(np);
	while (np) {
		if (of_device_is_compatible(np, "fpga-region")) {
			mgr_node = of_parse_phandle(np, "fpga-mgr", 0);
			if (mgr_node) {
				mgr = of_fpga_mgr_get(mgr_node);
				of_node_put(mgr_node);
				of_node_put(np);
				return mgr;
			}
		}
		np = of_get_next_parent(np);
	}
	of_node_put(np);
	return ERR_PTR(-EINVAL);
}
static struct fpga_manager * of_fpga_region_get_mgr ( struct device_node * np ) { struct device_node * mgr_node ; struct fpga_manager * mgr ; of_node_get ( np ) ; while ( np ) { if ( of_device_is_compatible ( np , " " ) ) { mgr_node = of_parse_phandle ( np , " " , 0 ) ; if ( mgr_node ) { mgr = of_fpga_mgr_get ( mgr_node ) ; of_node_put ( mgr_node ) ; of_node_put ( np ) ; return mgr ; } } np = of_get_next_parent ( np ) ; } of_node_put ( np ) ; return ERR_PTR ( - EINVAL ) ; }
of_fpga_region_get_mgr - get reference for FPGA manager
 @np: device node of FPGA region
of_fpga_region_get_mgr - get reference for FPGA manager @np : device node of FPGA region