Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a61b75d1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

USB: chipidea: no need to check return value of debugfs_create functions



When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b8fc7743
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ void hw_phymode_configure(struct ci_hdrc *ci);

void ci_platform_configure(struct ci_hdrc *ci);

int dbg_create_files(struct ci_hdrc *ci);
void dbg_create_files(struct ci_hdrc *ci);

void dbg_remove_files(struct ci_hdrc *ci);
#endif	/* __DRIVERS_USB_CHIPIDEA_CI_H */
+1 −3
Original line number Diff line number Diff line
@@ -1062,9 +1062,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
		ci_hdrc_otg_fsm_start(ci);

	device_set_wakeup_capable(&pdev->dev, true);
	ret = dbg_create_files(ci);
	if (ret)
		goto stop;
	dbg_create_files(ci);

	ret = sysfs_create_group(&dev->kobj, &ci_attr_group);
	if (ret)
+15 −41
Original line number Diff line number Diff line
@@ -340,54 +340,28 @@ DEFINE_SHOW_ATTRIBUTE(ci_registers);
 *
 * This function returns an error code
 */
int dbg_create_files(struct ci_hdrc *ci)
void dbg_create_files(struct ci_hdrc *ci)
{
	struct dentry *dent;

	ci->debugfs = debugfs_create_dir(dev_name(ci->dev), NULL);
	if (!ci->debugfs)
		return -ENOMEM;

	dent = debugfs_create_file("device", S_IRUGO, ci->debugfs, ci,
	debugfs_create_file("device", S_IRUGO, ci->debugfs, ci,
			    &ci_device_fops);
	if (!dent)
		goto err;

	dent = debugfs_create_file("port_test", S_IRUGO | S_IWUSR, ci->debugfs,
				   ci, &ci_port_test_fops);
	if (!dent)
		goto err;

	dent = debugfs_create_file("qheads", S_IRUGO, ci->debugfs, ci,
	debugfs_create_file("port_test", S_IRUGO | S_IWUSR, ci->debugfs, ci,
			    &ci_port_test_fops);
	debugfs_create_file("qheads", S_IRUGO, ci->debugfs, ci,
			    &ci_qheads_fops);
	if (!dent)
		goto err;

	dent = debugfs_create_file("requests", S_IRUGO, ci->debugfs, ci,
	debugfs_create_file("requests", S_IRUGO, ci->debugfs, ci,
			    &ci_requests_fops);
	if (!dent)
		goto err;

	if (ci_otg_is_fsm_mode(ci)) {
		dent = debugfs_create_file("otg", S_IRUGO, ci->debugfs, ci,
		debugfs_create_file("otg", S_IRUGO, ci->debugfs, ci,
				    &ci_otg_fops);
		if (!dent)
			goto err;
	}

	dent = debugfs_create_file("role", S_IRUGO | S_IWUSR, ci->debugfs, ci,
	debugfs_create_file("role", S_IRUGO | S_IWUSR, ci->debugfs, ci,
			    &ci_role_fops);
	if (!dent)
		goto err;

	dent = debugfs_create_file("registers", S_IRUGO, ci->debugfs, ci,
	debugfs_create_file("registers", S_IRUGO, ci->debugfs, ci,
			    &ci_registers_fops);

	if (dent)
		return 0;
err:
	debugfs_remove_recursive(ci->debugfs);
	return -ENOMEM;
}

/**