Example #1
0
/**
 * ubi_register_volume_notifier - register a volume notifier.
 * @nb: the notifier description object
 * @ignore_existing: if non-zero, do not send "added" notification for all
 *                   already existing volumes
 *
 * This function registers a volume notifier, which means that
 * 'nb->notifier_call()' will be invoked when an UBI  volume is created,
 * removed, re-sized, re-named, or updated. The first argument of the function
 * is the notification type. The second argument is pointer to a
 * &struct ubi_notification object which describes the notification event.
 * Using UBI API from the volume notifier is prohibited.
 *
 * This function returns zero in case of success and a negative error code
 * in case of failure.
 */
int ubi_register_volume_notifier(struct notifier_block *nb,
				 int ignore_existing)
{
	int err;

	err = blocking_notifier_chain_register(&ubi_notifiers, nb);
	if (err != 0)
		return err;
	if (ignore_existing)
		return 0;

	/*
	 * We are going to walk all UBI devices and all volumes, and
	 * notify the user about existing volumes by the %UBI_VOLUME_ADDED
	 * event. We have to lock the @ubi_devices_mutex to make sure UBI
	 * devices do not disappear.
	 */
	mutex_lock(&ubi_devices_mutex);
	ubi_enumerate_volumes(nb);
	mutex_unlock(&ubi_devices_mutex);

	return err;
}
struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb)
{
	struct omap_mbox *mbox;
	int ret;

	if (!mboxes)
		return ERR_PTR(-EINVAL);

	for (mbox = *mboxes; mbox; mbox++)
		if (!strcmp(mbox->name, name))
			break;

	if (!mbox)
		return ERR_PTR(-ENOENT);

	ret = omap_mbox_startup(mbox);
	if (ret)
		return ERR_PTR(-ENODEV);

	if (nb)
		blocking_notifier_chain_register(&mbox->notifier, nb);

	return mbox;
}
Example #3
0
int register_capictr_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&ctr_notifier_list, nb);
}
Example #4
0
int register_acpi_hed_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&acpi_hed_notify_list, nb);
}
Example #5
0
int dip_register_notifier(struct notifier_block *nb, unsigned int list)
{
	return blocking_notifier_chain_register(&dip_notifier_list, nb);
}
Example #6
0
void pm_scif_notifier_register(struct notifier_block *n)
{
	blocking_notifier_chain_register(&pm_scif_notifier, n);
}
Example #7
0
int register_notifier_by_touchkey(struct notifier_block *nb)
{
    return blocking_notifier_chain_register(&touchkey_notifier_list, nb);
}
int acc_register_notifier(struct notifier_block *nb)
{
	int ret;
	ret = blocking_notifier_chain_register(&acc_mhl_notifier, nb);
	return ret;
}
Example #9
0
int register_thermal_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&thermal_chain_head, nb);
}
int touch_register_client(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&touch_blocking_notifier, nb);
}
Example #11
0
static int hdmi_probe(struct snd_soc_codec *codec)
{
	struct platform_device *pdev = to_platform_device(codec->dev);
	struct resource *hdmi_rsrc;
	int ret = 0;

	snd_soc_codec_set_drvdata(codec, &hdmi_data);

	hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_MEM, 0);

	if (!hdmi_rsrc) {
		dev_err(&pdev->dev, "Cannot obtain IORESOURCE_MEM HDMI\n");
		ret = -EINVAL;
		goto res_err;
	}

	hdmi_data.oh = omap_hwmod_lookup("dss_hdmi");

	if (!hdmi_data.oh) {
		dev_err(&pdev->dev, "can't find omap_hwmod for hdmi\n");
		ret = -ENODEV;
		goto res_err;
	}

	/* Base address taken from platform */
	hdmi_data.ip_data.base_wp = ioremap(hdmi_rsrc->start,
					resource_size(hdmi_rsrc));

	if (!hdmi_data.ip_data.base_wp) {
		dev_err(&pdev->dev, "can't ioremap WP\n");
		ret = -ENOMEM;
		goto res_err;
	}

	hdmi_data.ip_data.hdmi_core_sys_offset = HDMI_CORE_SYS;
	hdmi_data.ip_data.hdmi_core_av_offset = HDMI_CORE_AV;
	hdmi_data.ip_data.hdmi_pll_offset = HDMI_PLLCTRL;
	hdmi_data.ip_data.hdmi_phy_offset = HDMI_PHY;

	hdmi_data.dssdev = omap_dss_find_device(NULL, hdmi_audio_match);

	if (!hdmi_data.dssdev) {
		ret = -ENODEV;
		goto dssdev_err;
	}else{
		dev_err(&pdev->dev, "found HDMI device\n");
	}

	hdmi_data.notifier.notifier_call = hdmi_audio_notifier_callback;
	blocking_notifier_chain_register(&hdmi_data.dssdev->state_notifiers,
			&hdmi_data.notifier);

	hdmi_data.workqueue = create_singlethread_workqueue("hdmi-codec");

	INIT_DELAYED_WORK(&hdmi_data.delayed_work, hdmi_audio_work);

	return 0;

dssdev_err:
	iounmap(hdmi_data.ip_data.base_wp);
res_err:
	return ret;

}
Example #12
0
int bq275xx_register_notifier(struct notifier_block *nb)
{
    return blocking_notifier_chain_register(&notifier_list, nb);
}
Example #13
0
int exynos_tmu_add_notifier(struct notifier_block *n)
{
	return blocking_notifier_chain_register(&exynos_tmu_notifier, n);
}
Example #14
0
/* --------------------------------------------------------------------------
                                Driver Interface
   -------------------------------------------------------------------------- */
int acpi_lid_notifier_register(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&acpi_lid_notifier, nb);
}
int hwmon_notifier_register(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&hwmon_notifier_list, nb);
}
/**
 *	lcd_register_client - register a client notifier
 *	@nb: notifier block to callback on events
 */
int lcd_register_client(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&lcd_notifier_list, nb);
}
Example #17
0
/**
 *	register_reboot_notifier - Register function to be called at reboot time
 *	@nb: Info about notifier function to be called
 *
 *	Registers a function with the list of functions
 *	to be called at reboot time.
 *
 *	Currently always returns zero, as blocking_notifier_chain_register()
 *	always returns zero.
 */
int register_reboot_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&reboot_notifier_list, nb);
}
Example #18
0
/*
 * Register a simple callback for handling any AB3100 events.
 */
int ab3100_event_register(struct ab3100 *ab3100,
			  struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&ab3100->event_subscribers,
					       nb);
}
Example #19
0
int register_inetaddr_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&inetaddr_chain, nb);
}
Example #20
0
/**
 * usb_register_notify - register a notifier callback whenever a usb change happens
 * @nb: pointer to the notifier block for the callback events.
 *
 * These changes are either USB devices or busses being added or removed.
 */
void usb_register_notify(struct notifier_block *nb)
{
    blocking_notifier_chain_register(&usb_notifier_list, nb);
}
int register_iom3_recovery_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&iom3_recovery_notifier_list, nb);
}
Example #22
0
void mdp3_ctrl_notifier_register(struct mdp3_session_data *ses,
	struct notifier_block *notifier)
{
	blocking_notifier_chain_register(&ses->notifier_head, notifier);
}
Example #23
0
int register_memory_notifier(struct notifier_block *nb)
{
        return blocking_notifier_chain_register(&memory_chain, nb);
}
int vmpressure_notifier_register(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&vmpressure_notifier, nb);
}
Example #25
0
int bus_register_notifier(struct bus_type *bus, struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&bus->p->bus_notifier, nb);
}
Example #26
0
int wcd9xxx_resmgr_register_notifier(struct wcd9xxx_resmgr *resmgr,
				     struct notifier_block *nblock)
{
	return blocking_notifier_chain_register(&resmgr->notifier, nblock);
}
Example #27
0
int register_notifier_by_psensor(struct notifier_block *nb)
{
    return blocking_notifier_chain_register(&psensor_notifier_list, nb);
}
int exynos_cpufreq_smpl_warn_register_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&exynos_cpufreq_smpl_warn_notifier_list, nb);
}
Example #29
0
int register_pm_notifier(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&pm_chain_head, nb);
}
Example #30
0
int of_reconfig_notifier_register(struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&of_reconfig_chain, nb);
}