Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337020
b: refs/heads/master
c: b299738
h: refs/heads/master
v: v3
  • Loading branch information
Matthias Kaehlcke authored and Greg Kroah-Hartman committed Nov 27, 2012
1 parent 24bc983 commit 3f6ed34
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2cf4e52e27dc719941cd3727205ca62b742f2746
refs/heads/master: b2997387c291ecf8015a89fc626f02be60e359a0
30 changes: 21 additions & 9 deletions trunk/drivers/misc/ti-st/st_kim.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,9 @@ static const struct file_operations list_debugfs_fops = {
static struct dentry *kim_debugfs_dir;
static int kim_probe(struct platform_device *pdev)
{
long status;
struct kim_data_s *kim_gdata;
struct ti_st_plat_data *pdata = pdev->dev.platform_data;
int err;

if ((pdev->id != -1) && (pdev->id < MAX_ST_DEVICES)) {
/* multiple devices could exist */
Expand All @@ -724,10 +724,11 @@ static int kim_probe(struct platform_device *pdev)
}
dev_set_drvdata(&pdev->dev, kim_gdata);

status = st_core_init(&kim_gdata->core_data);
if (status != 0) {
err = st_core_init(&kim_gdata->core_data);
if (err != 0) {
pr_err(" ST core init failed");
return -EIO;
err = -EIO;
goto err_core_init;
}
/* refer to itself */
kim_gdata->core_data->kim_data = kim_gdata;
Expand All @@ -738,10 +739,10 @@ static int kim_probe(struct platform_device *pdev)
init_completion(&kim_gdata->kim_rcvd);
init_completion(&kim_gdata->ldisc_installed);

status = sysfs_create_group(&pdev->dev.kobj, &uim_attr_grp);
if (status) {
err = sysfs_create_group(&pdev->dev.kobj, &uim_attr_grp);
if (err) {
pr_err("failed to create sysfs entries");
return status;
goto err_sysfs_group;
}

/* copying platform data */
Expand All @@ -753,8 +754,8 @@ static int kim_probe(struct platform_device *pdev)
kim_debugfs_dir = debugfs_create_dir("ti-st", NULL);
if (IS_ERR(kim_debugfs_dir)) {
pr_err(" debugfs entries creation failed ");
kim_debugfs_dir = NULL;
return -EIO;
err = -EIO;
goto err_debugfs_dir;
}

debugfs_create_file("version", S_IRUGO, kim_debugfs_dir,
Expand All @@ -763,6 +764,17 @@ static int kim_probe(struct platform_device *pdev)
kim_gdata, &list_debugfs_fops);
pr_info(" debugfs entries created ");
return 0;

err_debugfs_dir:
sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);

err_sysfs_group:
st_core_exit(kim_gdata->core_data);

err_core_init:
kfree(kim_gdata);

return err;
}

static int kim_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 3f6ed34

Please sign in to comment.