summaryrefslogtreecommitdiff
path: root/drivers/staging/olpc_dcon
diff options
context:
space:
mode:
authorJing Xiangfeng <jingxiangfeng@huawei.com>2020-11-20 15:49:32 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-09 19:45:13 +0100
commit4996b4610767064807d022dd731584f7ff78c309 (patch)
tree6d0ecf64d7e6d0c4b8502ba37931f024bae91f6c /drivers/staging/olpc_dcon
parent7fe5bbdd1f43806c1e38e69585d98d956fca43e8 (diff)
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: 53c43c5ca133 ("Revert "Staging: olpc_dcon: Remove obsolete driver"") Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com> Link: https://lore.kernel.org/r/20201120074932.31871-1-jingxiangfeng@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/olpc_dcon')
-rw-r--r--drivers/staging/olpc_dcon/olpc_dcon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index a0d6d90f4cc8..e7281212db5b 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -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);