summaryrefslogtreecommitdiff
path: root/drivers/i3c
diff options
context:
space:
mode:
authorJing Xiangfeng <jingxiangfeng@huawei.com>2020-09-11 11:33:50 +0800
committerBoris Brezillon <boris.brezillon@collabora.com>2020-10-07 15:14:07 +0200
commitabea14bfdebbe9bd02f2ad24a1f3a878ed21c8f0 (patch)
tree5199de5bd15f42268b1c7605c9c7d410d9caef04 /drivers/i3c
parentcc3a392d69b62e21d016f0d45be688af133f9122 (diff)
i3c: master: Fix error return in cdns_i3c_master_probe()
Fix to return negative error code -ENOMEM from the error handling case instead of 0. Fixes: 603f2bee2c54 ("i3c: master: Add driver for Cadence IP") Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-i3c/20200911033350.23904-1-jingxiangfeng@huawei.com
Diffstat (limited to 'drivers/i3c')
-rw-r--r--drivers/i3c/master/i3c-master-cdns.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
index 3fee8bd7fe20..3f2226928fe0 100644
--- a/drivers/i3c/master/i3c-master-cdns.c
+++ b/drivers/i3c/master/i3c-master-cdns.c
@@ -1635,8 +1635,10 @@ static int cdns_i3c_master_probe(struct platform_device *pdev)
master->ibi.slots = devm_kcalloc(&pdev->dev, master->ibi.num_slots,
sizeof(*master->ibi.slots),
GFP_KERNEL);
- if (!master->ibi.slots)
+ if (!master->ibi.slots) {
+ ret = -ENOMEM;
goto err_disable_sysclk;
+ }
writel(IBIR_THR(1), master->regs + CMD_IBI_THR_CTRL);
writel(MST_INT_IBIR_THR, master->regs + MST_IER);