Commit 4996b461 authored by Jing Xiangfeng's avatar Jing Xiangfeng Committed by Greg Kroah-Hartman

staging: olpc_dcon: Do not call platform_device_unregister() in dcon_probe()

In dcon_probe(), when platform_device_add() failes to add the device,
it jumps to call platform_device_unregister() to remove the device,
which is unnecessary. So use platform_device_put() instead.

Fixes: 53c43c5c ("Revert "Staging: olpc_dcon: Remove obsolete driver"")
Signed-off-by: default avatarJing Xiangfeng <jingxiangfeng@huawei.com>
Link: https://lore.kernel.org/r/20201120074932.31871-1-jingxiangfeng@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7fe5bbdd
......@@ -659,8 +659,9 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
ecreate:
for (j = 0; j < i; j++)
device_remove_file(&dcon_device->dev, &dcon_device_files[j]);
platform_device_del(dcon_device);
edev:
platform_device_unregister(dcon_device);
platform_device_put(dcon_device);
dcon_device = NULL;
eirq:
free_irq(DCON_IRQ, dcon);
......
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