linux/drivers/fpga/of-fpga-region.c
/**
 * of_fpga_region_notify - reconfig notifier for dynamic DT changes
 * @nb:		notifier block
 * @action:	notifier action
 * @arg:	reconfig data
 *
 * This notifier handles programming a FPGA when a "firmware-name" property is
 * added to a fpga-region.
 *
 * Returns NOTIFY_OK or error if FPGA programming fails.
 */
reconfig notifier for dynamic DT changes
@nb:         notifier block
@action:     notifier action
@arg:        reconfig data

This notifier handles programming a FPGA when a "firmware-name" property is
added to a fpga-region.

Returns NOTIFY_OK or error if FPGA programming fails.
reconfig notifier for dynamic DT changes @nb : notifier block @action : notifier action @arg : reconfig data This notifier handles programming a FPGA when a " firmware - name " property is added to a fpga - region . Returns NOTIFY_OK or error if FPGA programming fails .
static int of_fpga_region_notify(struct notifier_block *nb,
				 unsigned long action, void *arg)
{
	struct of_overlay_notify_data *nd = arg;
	struct fpga_region *region;
	int ret;
	switch (action) {
	case OF_OVERLAY_PRE_APPLY:
		pr_debug("%s OF_OVERLAY_PRE_APPLY\n", __func__);
		break;
	case OF_OVERLAY_POST_APPLY:
		pr_debug("%s OF_OVERLAY_POST_APPLY\n", __func__);
		return NOTIFY_OK;       
	case OF_OVERLAY_PRE_REMOVE:
		pr_debug("%s OF_OVERLAY_PRE_REMOVE\n", __func__);
		return NOTIFY_OK;       
	case OF_OVERLAY_POST_REMOVE:
		pr_debug("%s OF_OVERLAY_POST_REMOVE\n", __func__);
		break;
	default:			
		return NOTIFY_OK;
	}
	region = of_fpga_region_find(nd->target);
	if (!region)
		return NOTIFY_OK;
	ret = 0;
	switch (action) {
	case OF_OVERLAY_PRE_APPLY:
		ret = of_fpga_region_notify_pre_apply(region, nd);
		break;
	case OF_OVERLAY_POST_REMOVE:
		of_fpga_region_notify_post_remove(region, nd);
		break;
	}
	put_device(&region->dev);
	if (ret)
		return notifier_from_errno(ret);
	return NOTIFY_OK;
}
static int of_fpga_region_notify ( struct notifier_block * nb , unsigned long action , void * arg ) { struct of_overlay_notify_data * nd = arg ; struct fpga_region * region ; int ret ; switch ( action ) { case OF_OVERLAY_PRE_APPLY : pr_debug ( " \n " , __func__ ) ; break ; case OF_OVERLAY_POST_APPLY : pr_debug ( " \n " , __func__ ) ; return NOTIFY_OK ; case OF_OVERLAY_PRE_REMOVE : pr_debug ( " \n " , __func__ ) ; return NOTIFY_OK ; case OF_OVERLAY_POST_REMOVE : pr_debug ( " \n " , __func__ ) ; break ; default : return NOTIFY_OK ; } region = of_fpga_region_find ( nd -> target ) ; if ( ! region ) return NOTIFY_OK ; ret = 0 ; switch ( action ) { case OF_OVERLAY_PRE_APPLY : ret = of_fpga_region_notify_pre_apply ( region , nd ) ; break ; case OF_OVERLAY_POST_REMOVE : of_fpga_region_notify_post_remove ( region , nd ) ; break ; } put_device ( & region -> dev ) ; if ( ret ) return notifier_from_errno ( ret ) ; return NOTIFY_OK ; }
of_fpga_region_notify - reconfig notifier for dynamic DT changes
 @nb:         notifier block
 @action:     notifier action
 @arg:        reconfig data
of_fpga_region_notify - reconfig notifier for dynamic DT changes @nb : notifier block @action : notifier action @arg : reconfig data
/* not for us */ /* not for us */ /* should not happen */