bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 21 Apr 2022 14:35:49 +0000 (16:35 +0200)
committerJernej Skrabec <jernej.skrabec@gmail.com>
Mon, 25 Apr 2022 17:29:04 +0000 (19:29 +0200)
commitfff8c10368e64e7f8960f149375c12ca5f3b30af
tree5ac1a1425ad804c697d7d218d368120ff3f5073e
parent3123109284176b1532874591f7c81f3837bbdc17
bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create()

This code is really spurious.
It always returns an ERR_PTR, even when err is known to be 0 and calls
put_device() after a successful device_register() call.

It is likely that the return statement in the normal path is missing.
Add 'return rdev;' to fix it.

Fixes: d787dcdb9c8f ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/ef2b9576350bba4c8e05e669e9535e9e2a415763.1650551719.git.christophe.jaillet@wanadoo.fr
drivers/bus/sunxi-rsb.c