Commit 171dada7 authored by Imre Deak's avatar Imre Deak Committed by Tony Lindgren

TSC2301 touchscreen: fix error path in driver probe function

Signed-off-by: default avatarImre Deak <imre.deak@solidboot.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 4648dd52
...@@ -629,19 +629,23 @@ int __devinit tsc2301_ts_init(struct tsc2301 *tsc, ...@@ -629,19 +629,23 @@ int __devinit tsc2301_ts_init(struct tsc2301 *tsc,
} }
set_irq_wake(ts->irq, 1); set_irq_wake(ts->irq, 1);
device_create_file(&tsc->spi->dev, &dev_attr_pen_down); if (device_create_file(&tsc->spi->dev, &dev_attr_pen_down) < 0)
device_create_file(&tsc->spi->dev, &dev_attr_disable_ts); goto err4;
if (device_create_file(&tsc->spi->dev, &dev_attr_disable_ts) < 0)
goto err5;
r = input_register_device(idev); r = input_register_device(idev);
if (r < 0) { if (r < 0) {
dev_err(&tsc->spi->dev, "can't register touchscreen device\n"); dev_err(&tsc->spi->dev, "can't register touchscreen device\n");
goto err4; goto err6;
} }
return 0; return 0;
err4: err6:
device_remove_file(&tsc->spi->dev, &dev_attr_disable_ts); device_remove_file(&tsc->spi->dev, &dev_attr_disable_ts);
err5:
device_remove_file(&tsc->spi->dev, &dev_attr_pen_down); device_remove_file(&tsc->spi->dev, &dev_attr_pen_down);
err4:
free_irq(ts->irq, tsc); free_irq(ts->irq, tsc);
err3: err3:
tsc2301_ts_stop_scan(tsc); tsc2301_ts_stop_scan(tsc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment