提交 a1cd3fd0 编写于 作者: P Pramod Gurav 提交者: Dmitry Torokhov

Input: ads7846 - release resources on failure for clean exit

Input device must be released(input_free_device) when ads7846_probe_dt
fails. This fixes the same by releasing resources on failure.
Signed-off-by: NPramod Gurav <pramod.gurav@smartplayin.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 9d469d03
......@@ -1302,8 +1302,10 @@ static int ads7846_probe(struct spi_device *spi)
pdata = dev_get_platdata(&spi->dev);
if (!pdata) {
pdata = ads7846_probe_dt(&spi->dev);
if (IS_ERR(pdata))
return PTR_ERR(pdata);
if (IS_ERR(pdata)) {
err = PTR_ERR(pdata);
goto err_free_mem;
}
}
ts->model = pdata->model ? : 7846;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册