static int cyttsp5_loader_release(struct device *dev)
{
	struct cyttsp5_core_data *cd = dev_get_drvdata(dev);
	struct cyttsp5_loader_data *ld = cyttsp5_get_loader_data(dev);
	int rc = 0;

#if CYTTSP5_FW_UPGRADE
	cmd->unsubscribe_attention(dev, CY_ATTEN_IRQ, CY_MODULE_LOADER,
		cyttsp5_loader_attention, CY_MODE_BOOTLOADER);

	cmd->unsubscribe_attention(dev, CY_ATTEN_LOADER, CY_MODULE_LOADER,
		cyttsp5_fw_upgrade_cb, CY_MODE_UNKNOWN);
#endif
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP568_MANUAL_TTCONFIG_UPGRADE
	device_remove_bin_file(dev, &bin_attr_config_data);
	device_remove_file(dev, &dev_attr_config_loading);
	kfree(ld->config_data);
#endif
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP568_BINARY_FW_UPGRADE
	device_remove_file(dev, &dev_attr_manual_upgrade);
#endif
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP568_PLATFORM_FW_UPGRADE
	device_remove_file(dev, &dev_attr_forced_upgrade);
#endif
	cd->cyttsp5_dynamic_data[CY_MODULE_LOADER] = NULL;
	kfree(ld);
	return rc;
}
Example #2
0
static int __init olpc_bat_init(void)
{
	int ret = 0;
	uint8_t status;

	if (!olpc_platform_info.ecver)
		return -ENXIO;

	/*
	 * We've seen a number of EC protocol changes; this driver requires
	 * the latest EC protocol, supported by 0x44 and above.
	 */
	if (olpc_platform_info.ecver < 0x44) {
		printk(KERN_NOTICE "OLPC EC version 0x%02x too old for "
			"battery driver.\n", olpc_platform_info.ecver);
		return -ENXIO;
	}

	ret = olpc_ec_cmd(EC_BAT_STATUS, NULL, 0, &status, 1);
	if (ret)
		return ret;

	/* Ignore the status. It doesn't actually matter */

	bat_pdev = platform_device_register_simple("olpc-battery", 0, NULL, 0);
	if (IS_ERR(bat_pdev))
		return PTR_ERR(bat_pdev);

	ret = power_supply_register(&bat_pdev->dev, &olpc_ac);
	if (ret)
		goto ac_failed;

	olpc_bat.name = bat_pdev->name;

	ret = power_supply_register(&bat_pdev->dev, &olpc_bat);
	if (ret)
		goto battery_failed;

	ret = device_create_bin_file(olpc_bat.dev, &olpc_bat_eeprom);
	if (ret)
		goto eeprom_failed;

	ret = device_create_file(olpc_bat.dev, &olpc_bat_error);
	if (ret)
		goto error_failed;

	goto success;

error_failed:
	device_remove_bin_file(olpc_bat.dev, &olpc_bat_eeprom);
eeprom_failed:
	power_supply_unregister(&olpc_bat);
battery_failed:
	power_supply_unregister(&olpc_ac);
ac_failed:
	platform_device_unregister(bat_pdev);
success:
	return ret;
}
Example #3
0
void usb_remove_sysfs_dev_files(struct usb_device *udev)
{
	struct device *dev = &udev->dev;

	remove_power_attributes(dev);
	remove_persist_attributes(dev);
	device_remove_bin_file(dev, &dev_bin_attr_descriptors);
}
Example #4
0
void wlcore_sysfs_free(struct wl1271 *wl)
{
	device_remove_bin_file(wl->dev, &fwlog_attr);

	device_remove_file(wl->dev, &dev_attr_hw_pg_ver);

	device_remove_file(wl->dev, &dev_attr_bt_coex_state);
}
Example #5
0
static void __exit olpc_bat_exit(void)
{
	device_remove_file(olpc_bat.dev, &olpc_bat_error);
	device_remove_bin_file(olpc_bat.dev, &olpc_bat_eeprom);
	power_supply_unregister(&olpc_bat);
	power_supply_unregister(&olpc_ac);
	platform_device_unregister(bat_pdev);
}
void remove_sysfs_files() { int thread_id = corral_getThreadID();
  corral_atomic_begin();
  __hv_assume ((sysfs_lock) == (0));
  sysfs_lock = thread_id;
  corral_atomic_end();
  device_remove_bin_file();
  sysfs_lock = 0;
}
Example #7
0
static int olpc_battery_remove(struct platform_device *pdev)
{
	device_remove_file(&olpc_bat->dev, &olpc_bat_error);
	device_remove_bin_file(&olpc_bat->dev, &olpc_bat_eeprom);
	power_supply_unregister(olpc_bat);
	power_supply_unregister(olpc_ac);
	return 0;
}
Example #8
0
static int __init olpc_bat_init(void)
{
	int ret = 0;
	uint8_t status;

	if (!olpc_platform_info.ecver)
		return -ENXIO;

	
	if (olpc_platform_info.ecver < 0x44) {
		printk(KERN_NOTICE "OLPC EC version 0x%02x too old for "
			"battery driver.\n", olpc_platform_info.ecver);
		return -ENXIO;
	}

	ret = olpc_ec_cmd(EC_BAT_STATUS, NULL, 0, &status, 1);
	if (ret)
		return ret;

	

	bat_pdev = platform_device_register_simple("olpc-battery", 0, NULL, 0);
	if (IS_ERR(bat_pdev))
		return PTR_ERR(bat_pdev);

	ret = power_supply_register(&bat_pdev->dev, &olpc_ac);
	if (ret)
		goto ac_failed;

	olpc_bat.name = bat_pdev->name;

	ret = power_supply_register(&bat_pdev->dev, &olpc_bat);
	if (ret)
		goto battery_failed;

	ret = device_create_bin_file(olpc_bat.dev, &olpc_bat_eeprom);
	if (ret)
		goto eeprom_failed;

	ret = device_create_file(olpc_bat.dev, &olpc_bat_error);
	if (ret)
		goto error_failed;

	goto success;

error_failed:
	device_remove_bin_file(olpc_bat.dev, &olpc_bat_eeprom);
eeprom_failed:
	power_supply_unregister(&olpc_bat);
battery_failed:
	power_supply_unregister(&olpc_ac);
ac_failed:
	platform_device_unregister(bat_pdev);
success:
	return ret;
}
Example #9
0
File: chp.c Project: 19Dan01/linux
int chp_add_cmg_attr(struct channel_path *chp)
{
	int ret;

	ret = device_create_bin_file(&chp->dev, &chp_measurement_chars_attr);
	if (ret)
		return ret;
	ret = device_create_bin_file(&chp->dev, &chp_measurement_attr);
	if (ret)
		device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr);
	return ret;
}
Example #10
0
void remove_sysfs_files() {
  noReorderBegin();
    want_sysfs = 5;
    atomicBegin();
      assume(sysfs_lock == 0);
      sysfs_lock = 5;
      want_sysfs = 0;
    atomicEnd();
  noReorderEnd();
  device_remove_bin_file();
  unlock(sysfs_lock);
}
Example #11
0
void usb_remove_sysfs_dev_files(struct usb_device *udev)
{
	struct device *dev = &udev->dev;

	usb_remove_ep_files(&udev->ep0);
	device_remove_file(dev, &dev_attr_manufacturer);
	device_remove_file(dev, &dev_attr_product);
	device_remove_file(dev, &dev_attr_serial);
	remove_power_attributes(dev);
	device_remove_bin_file(dev, &dev_bin_attr_descriptors);
	sysfs_remove_group(&dev->kobj, &dev_attr_grp);
}
Example #12
0
static void
mic_remove(struct pci_dev *pdev)
{
	int32_t brdnum;
	bd_info_t *bd_info;

	if (mic_data.dd_numdevs - 1 < 0)
		return;
	mic_data.dd_numdevs--;
	brdnum = mic_data.dd_numdevs;

	/* Make sure boards are shutdown and not available. */
	bd_info = mic_data.dd_bi[brdnum];

	spin_lock_bh(&bd_info->bi_ctx.sysfs_lock);
	sysfs_put(bd_info->bi_ctx.sysfs_state);
	bd_info->bi_ctx.sysfs_state = NULL;
	spin_unlock_bh(&bd_info->bi_ctx.sysfs_lock);

	if (bd_info->bi_ctx.bi_psmi.enabled) {
		device_remove_bin_file(bd_info->bi_sysfsdev, &mic_psmi_ptes_attr);
		sysfs_remove_group(&bd_info->bi_sysfsdev->kobj, &psmi_attr_group);
	}
	sysfs_remove_group(&bd_info->bi_sysfsdev->kobj, &bd_attr_group);

	free_sysfs_entries(&bd_info->bi_ctx);
	device_destroy(mic_lindata.dd_class,
		       mic_lindata.dd_dev + 2 + bd_info->bi_ctx.bi_id);

	adapter_stop_device(&bd_info->bi_ctx, 1, 0);
	/*
	 * Need to wait for reset since accessing the card while GDDR training
	 * is ongoing by adapter_remove(..) below for example can be fatal.
	 */
	wait_for_reset(&bd_info->bi_ctx);

	mic_disable_interrupts(&bd_info->bi_ctx);

	if (!bd_info->bi_ctx.msie) {
		free_irq(bd_info->bi_ctx.bi_pdev->irq, &bd_info->bi_ctx);
#ifdef CONFIG_PCI_MSI
	} else {
		free_irq(bd_info->bi_msix_entries[0].vector, &bd_info->bi_ctx);
		pci_disable_msix(bd_info->bi_ctx.bi_pdev);
#endif
	}
	adapter_remove(&bd_info->bi_ctx);
	release_mem_region(bd_info->bi_ctx.aper.pa, bd_info->bi_ctx.aper.len);
	release_mem_region(bd_info->bi_ctx.mmio.pa, bd_info->bi_ctx.mmio.len);
	pci_disable_device(bd_info->bi_ctx.bi_pdev);
	kfree(bd_info);
}
static void __exit hdmi_module_exit(void)
{
	__inf("hdmi_module_exit\n");

	printk("%s %s %d\n",__FILE__,__func__,__LINE__);
	device_remove_bin_file(hdmi_edid_sysfs_dev, &dev_attr_edid);
	platform_driver_unregister(&hdmi_driver);
	platform_device_unregister(&hdmi_device);

	class_destroy(hdmi_class);

	cdev_del(my_cdev);
}
Example #14
0
void c2port_device_unregister(struct c2port_device *c2dev)
{
	if (!c2dev)
		return;

	dev_info(c2dev->dev, "C2 port %s removed\n", c2dev->name);

	device_remove_bin_file(c2dev->dev, &c2port_bin_attrs);
	spin_lock_irq(&c2port_idr_lock);
	idr_remove(&c2port_idr, c2dev->id);
	spin_unlock_irq(&c2port_idr_lock);

	device_destroy(c2port_class, c2dev->id);

	kfree(c2dev);
}
Example #15
0
File: chp.c Project: 19Dan01/linux
void chp_remove_cmg_attr(struct channel_path *chp)
{
	device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr);
	device_remove_bin_file(&chp->dev, &chp_measurement_attr);
}
void remove_sysfs_files() {
  lock(sysfs_lock);
  device_remove_bin_file();
  unlock(sysfs_lock);
}
Example #17
0
static int olpc_battery_probe(struct platform_device *pdev)
{
	int ret;
	uint8_t status;

	/*
	 * We've seen a number of EC protocol changes; this driver requires
	 * the latest EC protocol, supported by 0x44 and above.
	 */
	if (olpc_platform_info.ecver < 0x44) {
		printk(KERN_NOTICE "OLPC EC version 0x%02x too old for "
			"battery driver.\n", olpc_platform_info.ecver);
		return -ENXIO;
	}

	ret = olpc_ec_cmd(EC_BAT_STATUS, NULL, 0, &status, 1);
	if (ret)
		return ret;

	/* Ignore the status. It doesn't actually matter */

	olpc_ac = power_supply_register(&pdev->dev, &olpc_ac_desc, NULL);
	if (IS_ERR(olpc_ac))
		return PTR_ERR(olpc_ac);

	if (olpc_board_at_least(olpc_board_pre(0xd0))) { /* XO-1.5 */
		olpc_bat_desc.properties = olpc_xo15_bat_props;
		olpc_bat_desc.num_properties = ARRAY_SIZE(olpc_xo15_bat_props);
	} else { /* XO-1 */
		olpc_bat_desc.properties = olpc_xo1_bat_props;
		olpc_bat_desc.num_properties = ARRAY_SIZE(olpc_xo1_bat_props);
	}

	olpc_bat = power_supply_register(&pdev->dev, &olpc_bat_desc, NULL);
	if (IS_ERR(olpc_bat)) {
		ret = PTR_ERR(olpc_bat);
		goto battery_failed;
	}

	ret = device_create_bin_file(&olpc_bat->dev, &olpc_bat_eeprom);
	if (ret)
		goto eeprom_failed;

	ret = device_create_file(&olpc_bat->dev, &olpc_bat_error);
	if (ret)
		goto error_failed;

	if (olpc_ec_wakeup_available()) {
		device_set_wakeup_capable(&olpc_ac->dev, true);
		device_set_wakeup_capable(&olpc_bat->dev, true);
	}

	return 0;

error_failed:
	device_remove_bin_file(&olpc_bat->dev, &olpc_bat_eeprom);
eeprom_failed:
	power_supply_unregister(olpc_bat);
battery_failed:
	power_supply_unregister(olpc_ac);
	return ret;
}