Exemplo n.º 1
0
/**
 * ixgbe_dbg_exit - clean out the driver's debugfs entries
 **/
void ixgbe_dbg_exit(void)
{
	debugfs_remove_recursive(ixgbe_dbg_root);
}
Exemplo n.º 2
0
static void usb_debugfs_remove(void)
{
	debugfs_remove_recursive(gs_dent);
}
Exemplo n.º 3
0
static void dss_uninitialize_debugfs(void)
{
	if (dss_debugfs_dir)
		debugfs_remove_recursive(dss_debugfs_dir);
}
void ag71xx_debugfs_exit(struct ag71xx *ag)
{
    debugfs_remove_recursive(ag->debug.debugfs_dir);
}
Exemplo n.º 5
0
void mmc_remove_host_debugfs(struct mmc_host *host)
{
	debugfs_remove_recursive(host->debugfs_root);
        host->debugfs_root = NULL;
}
Exemplo n.º 6
0
/**
 * dbg_debug_exit_dev - free all debugfs files corresponding to device @ubi
 * @ubi: UBI device description object
 */
void ubi_debugfs_exit_dev(struct ubi_device *ubi)
{
	if (IS_ENABLED(CONFIG_DEBUG_FS))
		debugfs_remove_recursive(ubi->dbg.dfs_dir);
}
Exemplo n.º 7
0
void nfp_net_debugfs_adapter_del(struct nfp_net *nn)
{
	debugfs_remove_recursive(nn->debugfs_dir);
	nn->debugfs_dir = NULL;
}
static int ufs_test_debugfs_init(void)
{
	struct dentry *utils_root, *tests_root;
	int ret = 0;

	utils_root = test_iosched_get_debugfs_utils_root();
	tests_root = test_iosched_get_debugfs_tests_root();

	if (!utils_root || !tests_root) {
		test_pr_err("%s: Failed to create debugfs root.", __func__);
		ret = -EINVAL;
		goto exit;
	}

	utd->debug.random_test_seed = debugfs_create_u32("random_test_seed",
			S_IRUGO | S_IWUGO, utils_root, &utd->random_test_seed);

	if (!utd->debug.random_test_seed) {
		test_pr_err("%s: Could not create debugfs random_test_seed.",
				__func__);
		ret = -ENOMEM;
		goto exit;
	}

	utd->debug.write_read_test = debugfs_create_file("ufs_write_read_test",
					S_IRUGO | S_IWUGO, tests_root,
					NULL, &write_read_test_ops);

	if (!utd->debug.write_read_test) {
		ret = -ENOMEM;
		goto exit_err;
	}

	utd->debug.long_sequential_read_test = debugfs_create_file(
					"ufs_long_sequential_read_test",
					S_IRUGO | S_IWUGO,
					tests_root,
					NULL,
					&long_sequential_read_test_ops);

	if (!utd->debug.long_sequential_read_test) {
		ret = -ENOMEM;
		goto exit_err;
	}

	utd->debug.long_sequential_write_test = debugfs_create_file(
					"ufs_long_sequential_write_test",
					S_IRUGO | S_IWUGO,
					tests_root,
					NULL,
					&long_sequential_write_test_ops);

	if (!utd->debug.long_sequential_write_test) {
		ret = -ENOMEM;
		goto exit_err;
	}

	goto exit;

exit_err:
	debugfs_remove_recursive(tests_root);
exit:
	return ret;
}
static void ghsuart_ctrl_debugfs_exit(void)
{
	debugfs_remove_recursive(ghsuart_ctrl_dent);
}
Exemplo n.º 10
0
static void hsu_debugfs_remove(struct hsu_port *hsu)
{
	if (hsu->debugfs)
		debugfs_remove_recursive(hsu->debugfs);
}
Exemplo n.º 11
0
static void ufs_test_debugfs_cleanup(void)
{
	debugfs_remove_recursive(test_iosched_get_debugfs_tests_root());
}
Exemplo n.º 12
0
static int bq24192_probe(struct i2c_client *client,
				  const struct i2c_device_id *id)
{
	const struct bq24192_platform_data *pdata;
	struct device_node *dev_node = client->dev.of_node;
	struct bq24192_chip *chip;
	int ret = 0;
	unsigned long flags;

	if (!i2c_check_functionality(client->adapter,
				I2C_FUNC_SMBUS_BYTE_DATA)) {
		pr_err("i2c func fail.\n");
		return -EIO;
	}

	chip = kzalloc(sizeof(struct bq24192_chip), GFP_KERNEL);
	if (!chip) {
		pr_err("failed to alloc memory\n");
		return -ENOMEM;
	}

	chip->client = client;

	chip->usb_psy = power_supply_get_by_name("usb");
	if (!chip->usb_psy) {
		pr_err("usb supply not found deferring probe\n");
		ret = -EPROBE_DEFER;
		goto error;
	}

	if (dev_node) {
		ret = bq24192_parse_dt(dev_node, chip);
		if (ret) {
			pr_err("failed to parse dt\n");
			goto error;
		}
	} else {
		pdata = client->dev.platform_data;
		if (pdata == NULL) {
			pr_err("no platform data.\n");
			return -EINVAL;
		}

		chip->int_gpio = pdata->int_gpio;
		chip->chg_current_ma = pdata->chg_current_ma;
		chip->term_current_ma = pdata->term_current_ma;
		chip->wlc_support = pdata->wlc_support;
		chip->ext_ovp_otg_ctrl = pdata->ext_ovp_otg_ctrl;
		if (chip->ext_ovp_otg_ctrl)
			chip->otg_en_gpio = pdata->otg_en_gpio;
		chip->step_dwn_thr_mv = pdata->step_dwn_thr_mv;
		chip->step_dwn_currnet_ma = pdata->step_dwn_currnet_ma;
		chip->vbat_max_mv = pdata->vbat_max_mv;
		chip->pre_chg_current_ma = pdata->pre_chg_current_ma;
		chip->sys_vmin_mv = pdata->sys_vmin_mv;
		chip->vin_limit_mv = pdata->vin_limit_mv;
		chip->icl_vbus_mv = pdata->icl_vbus_mv;
		chip->wlc_dwn_i_ma = pdata->wlc_dwn_i_ma;
	}
	chip->set_chg_current_ma = chip->chg_current_ma;
	chip->batt_health = POWER_SUPPLY_HEALTH_GOOD;
	chip->max_input_i_ma = INPUT_CURRENT_LIMIT_MAX_MA;

	if (chip->wlc_support) {
		chip->wlc_psy = power_supply_get_by_name("wireless");
		if (!chip->wlc_psy) {
			pr_err("wireless supply not found deferring probe\n");
			ret = -EPROBE_DEFER;
			goto error;
		}
	}

	ret =  gpio_request_one(chip->int_gpio, GPIOF_DIR_IN,
			"bq24192_int");
	if (ret) {
		pr_err("failed to request int_gpio\n");
		goto error;
	}

	chip->irq = gpio_to_irq(chip->int_gpio);

	if (chip->otg_en_gpio) {
		ret = gpio_request_one(chip->otg_en_gpio,
				GPIOF_OUT_INIT_LOW, "otg_en");
		if (ret) {
			pr_err("otg_en_gpio request failed for %d ret=%d\n",
					chip->otg_en_gpio, ret);
			goto err_otg_en_gpio;
		}
	}

	i2c_set_clientdata(client, chip);

	ret = bq24192_hw_init(chip);
	if (ret) {
		pr_err("failed to init hw\n");
		goto err_hw_init;
	}

	the_chip = chip;

	ret = bq24192_init_ac_psy(chip);
	if (ret) {
		pr_err("bq24192_init_ac_psy failed\n");
		goto err_hw_init;
	}

	ret = bq24192_create_debugfs_entries(chip);
	if (ret) {
		pr_err("bq24192_create_debugfs_entries failed\n");
		goto err_debugfs;
	}

	spin_lock_init(&chip->irq_work_lock);
	chip->irq_scheduled_time_status = 0;

	wake_lock_init(&chip->chg_wake_lock,
		       WAKE_LOCK_SUSPEND, BQ24192_NAME);
	wake_lock_init(&chip->icl_wake_lock,
		       WAKE_LOCK_SUSPEND, "icl_wake_lock");
	wake_lock_init(&chip->irq_wake_lock,
			WAKE_LOCK_SUSPEND, BQ24192_NAME "irq");
	wake_lock_init(&chip->extra_chg_lock,
			WAKE_LOCK_SUSPEND, "extra_chg_lock");

	INIT_DELAYED_WORK(&chip->vbat_work, bq24192_vbat_work);
	INIT_DELAYED_WORK(&chip->input_limit_work, bq24192_input_limit_worker);
	INIT_DELAYED_WORK(&chip->therm_work, bq24192_therm_mitigation_work);
	INIT_DELAYED_WORK(&chip->extra_chg_work, bq24192_extra_chg_work);
	INIT_WORK(&chip->irq_work, bq24192_irq_worker);
	if (chip->irq) {
		ret = request_irq(chip->irq, bq24192_irq,
				IRQF_TRIGGER_FALLING,
				"bq24192_irq", chip);
		if (ret) {
			pr_err("request_irq %d failed\n", chip->irq);
			goto err_req_irq;
		}
		enable_irq_wake(chip->irq);
	}

	bq24192_enable_charging(chip, true);

	spin_lock_irqsave(&chip->irq_work_lock, flags);
	if (chip->irq_scheduled_time_status == 0) {
		schedule_work(&chip->irq_work);
		chip->irq_scheduled_time_status = 20;
	}
	spin_unlock_irqrestore(&chip->irq_work_lock, flags);

	pr_debug("probe success\n");

	return 0;

err_req_irq:
	wake_lock_destroy(&chip->chg_wake_lock);
	wake_lock_destroy(&chip->icl_wake_lock);
	wake_lock_destroy(&chip->irq_wake_lock);
	wake_lock_destroy(&chip->extra_chg_lock);
	if (chip->dent)
		debugfs_remove_recursive(chip->dent);
err_debugfs:
	power_supply_unregister(&chip->ac_psy);
err_hw_init:
	if (chip->otg_en_gpio)
		   gpio_free(chip->otg_en_gpio);
err_otg_en_gpio:
	if (chip->int_gpio)
		gpio_free(chip->int_gpio);
error:
	kfree(chip);
	pr_debug("fail to probe\n");
	return ret;

}
Exemplo n.º 13
0
static void __exit zswap_debugfs_exit(void)
{
	debugfs_remove_recursive(zswap_debugfs_root);
}
void kgsl_core_debugfs_close(void)
{
	debugfs_remove_recursive(kgsl_debugfs_dir);
}
Exemplo n.º 15
0
static void __exit acpi_ec_sys_exit(void)
{
	debugfs_remove_recursive(acpi_ec_debugfs_dir);
}
Exemplo n.º 16
0
static void ncp373_debugfs_cleanup(struct ncp373_internal *dev)
{
	if (!dev)
		return;
	debugfs_remove_recursive(dev->debugfs_root);
}
Exemplo n.º 17
0
/**
 * ubi_debugfs_init_dev - initialize debugfs for an UBI device.
 * @ubi: UBI device description object
 *
 * This function creates all debugfs files for UBI device @ubi. Returns zero in
 * case of success and a negative error code in case of failure.
 */
int ubi_debugfs_init_dev(struct ubi_device *ubi)
{
	int err, n;
	unsigned long ubi_num = ubi->ubi_num;
	const char *fname;
	struct dentry *dent;
	struct ubi_debug_info *d = &ubi->dbg;

	if (!IS_ENABLED(CONFIG_DEBUG_FS))
		return 0;

	n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME,
		     ubi->ubi_num);
	if (n == UBI_DFS_DIR_LEN) {
		/* The array size is too small */
		fname = UBI_DFS_DIR_NAME;
		dent = ERR_PTR(-EINVAL);
		goto out;
	}

	fname = d->dfs_dir_name;
	dent = debugfs_create_dir(fname, dfs_rootdir);
	if (IS_ERR_OR_NULL(dent))
		goto out;
	d->dfs_dir = dent;

	fname = "chk_gen";
	dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, (void *)ubi_num,
				   &dfs_fops);
	if (IS_ERR_OR_NULL(dent))
		goto out_remove;
	d->dfs_chk_gen = dent;

	fname = "chk_io";
	dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, (void *)ubi_num,
				   &dfs_fops);
	if (IS_ERR_OR_NULL(dent))
		goto out_remove;
	d->dfs_chk_io = dent;

	fname = "tst_disable_bgt";
	dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, (void *)ubi_num,
				   &dfs_fops);
	if (IS_ERR_OR_NULL(dent))
		goto out_remove;
	d->dfs_disable_bgt = dent;

	fname = "tst_emulate_bitflips";
	dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, (void *)ubi_num,
				   &dfs_fops);
	if (IS_ERR_OR_NULL(dent))
		goto out_remove;
	d->dfs_emulate_bitflips = dent;

	fname = "tst_emulate_io_failures";
	dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, (void *)ubi_num,
				   &dfs_fops);
	if (IS_ERR_OR_NULL(dent))
		goto out_remove;
	d->dfs_emulate_io_failures = dent;

	return 0;

out_remove:
	debugfs_remove_recursive(d->dfs_dir);
out:
	err = dent ? PTR_ERR(dent) : -ENODEV;
	ubi_err("cannot create \"%s\" debugfs file or directory, error %d\n",
		fname, err);
	return err;
}
static int __init ksb_init(void)
{
	struct ks_bridge *ksb;
	int num_instances = 0;
	int ret = 0;
	int i;

	dbg_dir = debugfs_create_dir("ks_bridge", NULL);
	if (IS_ERR(dbg_dir))
		pr_err("unable to create debug dir");

	for (i = 0; i < NO_BRIDGE_INSTANCES; i++) {
		ksb = kzalloc(sizeof(struct ks_bridge), GFP_KERNEL);
		if (!ksb) {
			pr_err("unable to allocat mem for ks_bridge");
			ret =  -ENOMEM;
			goto dev_free;
		}
		__ksb[i] = ksb;

		ksb->name = kasprintf(GFP_KERNEL, "ks_bridge:%i", i + 1);
		if (!ksb->name) {
			pr_info("unable to allocate name");
			kfree(ksb);
			ret = -ENOMEM;
			goto dev_free;
		}

		spin_lock_init(&ksb->lock);
		INIT_LIST_HEAD(&ksb->to_mdm_list);
		INIT_LIST_HEAD(&ksb->to_ks_list);
		init_waitqueue_head(&ksb->ks_wait_q);
		init_waitqueue_head(&ksb->pending_urb_wait);
		ksb->wq = create_singlethread_workqueue(ksb->name);
		if (!ksb->wq) {
			pr_err("unable to allocate workqueue");
			kfree(ksb->name);
			kfree(ksb);
			ret = -ENOMEM;
			goto dev_free;
		}

		INIT_WORK(&ksb->to_mdm_work, ksb_tomdm_work);
		INIT_WORK(&ksb->start_rx_work, ksb_start_rx_work);
		init_usb_anchor(&ksb->submitted);

		ksb->dbg_idx = 0;
		ksb->dbg_lock = __RW_LOCK_UNLOCKED(lck);

		if (!IS_ERR(dbg_dir))
			debugfs_create_file(ksb->name, S_IRUGO, dbg_dir,
					ksb, &dbg_fops);

		num_instances++;
	}

	ret = usb_register(&ksb_usb_driver);
	if (ret) {
		pr_err("unable to register ks bridge driver");
		goto dev_free;
	}

	pr_info("init done");

	return 0;

dev_free:
	if (!IS_ERR(dbg_dir))
		debugfs_remove_recursive(dbg_dir);

	for (i = 0; i < num_instances; i++) {
		ksb = __ksb[i];

		destroy_workqueue(ksb->wq);
		kfree(ksb->name);
		kfree(ksb);
	}

	return ret;

}
Exemplo n.º 19
0
static void qti_ctrl_debugfs_exit(void)
{
	debugfs_remove_recursive(qti_ctrl_dent);
}
Exemplo n.º 20
0
void i2400m_debugfs_rm(struct i2400m *i2400m)
{
    debugfs_remove_recursive(i2400m->debugfs_dentry);
}
Exemplo n.º 21
0
void nfp_net_debugfs_destroy(void)
{
	debugfs_remove_recursive(nfp_dir);
	nfp_dir = NULL;
}
Exemplo n.º 22
0
static void __exit tool_exit(void)
{
	ntb_unregister_client(&tool_client);
	debugfs_remove_recursive(tool_dbgfs);
}
Exemplo n.º 23
0
void bond_destroy_debugfs(void)
{
	debugfs_remove_recursive(bonding_debug_root);
	bonding_debug_root = NULL;
}
Exemplo n.º 24
0
static int tool_probe(struct ntb_client *self, struct ntb_dev *ntb)
{
	struct tool_ctx *tc;
	int rc;
	int i;

	if (!ntb->ops->mw_set_trans) {
		dev_dbg(&ntb->dev, "need inbound MW based NTB API\n");
		rc = -EINVAL;
		goto err_tc;
	}

	if (ntb_spad_count(ntb) < 1) {
		dev_dbg(&ntb->dev, "no enough scratchpads\n");
		rc = -EINVAL;
		goto err_tc;
	}

	if (ntb_db_is_unsafe(ntb))
		dev_dbg(&ntb->dev, "doorbell is unsafe\n");

	if (ntb_spad_is_unsafe(ntb))
		dev_dbg(&ntb->dev, "scratchpad is unsafe\n");

	if (ntb_peer_port_count(ntb) != NTB_DEF_PEER_CNT)
		dev_warn(&ntb->dev, "multi-port NTB is unsupported\n");

	tc = kzalloc(sizeof(*tc), GFP_KERNEL);
	if (!tc) {
		rc = -ENOMEM;
		goto err_tc;
	}

	tc->ntb = ntb;
	init_waitqueue_head(&tc->link_wq);

	tc->mw_count = min(ntb_peer_mw_count(tc->ntb), MAX_MWS);
	for (i = 0; i < tc->mw_count; i++) {
		rc = tool_init_mw(tc, i);
		if (rc)
			goto err_ctx;
	}

	tool_setup_dbgfs(tc);

	rc = ntb_set_ctx(ntb, tc, &tool_ops);
	if (rc)
		goto err_ctx;

	ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO);
	ntb_link_event(ntb);

	return 0;

err_ctx:
	tool_free_mws(tc);
	debugfs_remove_recursive(tc->dbgfs);
	kfree(tc);
err_tc:
	return rc;
}
Exemplo n.º 25
0
void mmc_remove_card_debugfs(struct mmc_card *card)
{
	debugfs_remove_recursive(card->debugfs_root);
        card->debugfs_root = NULL;
}
Exemplo n.º 26
0
static void dw_spi_debugfs_remove(struct dw_spi *dws)
{
	debugfs_remove_recursive(dws->debugfs);
}
Exemplo n.º 27
0
void wilc_debugfs_remove(void)
{
	debugfs_remove_recursive(wilc_dir);
}
Exemplo n.º 28
0
static void devfreq_watermark_debug_stop(struct devfreq *df)
{
	struct wmark_gov_info *wmarkinfo = df->data;
	debugfs_remove_recursive(wmarkinfo->debugdir);
}
Exemplo n.º 29
0
static void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
{
	debugfs_remove_recursive(aat2870->dentry_root);
}
Exemplo n.º 30
0
/**
 * ixgbe_dbg_adapter_exit - clear out the adapter's debugfs entries
 * @pf: the pf that is stopping
 **/
void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter)
{
	if (adapter->ixgbe_dbg_adapter)
		debugfs_remove_recursive(adapter->ixgbe_dbg_adapter);
	adapter->ixgbe_dbg_adapter = NULL;
}