]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: tua9001: Improve messages in .remove's error path
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 26 Oct 2021 19:40:10 +0000 (21:40 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 7 Dec 2021 10:29:57 +0000 (11:29 +0100)
If disabling the hardware fails the driver propagates the error code to
the i2c core. However this only results in a generic error message; the
device still disappears.

So instead emit a message that better describes the actual problem than
the i2c core's "remove failed (ESOMETHING), will be ignored" and return
0 to suppress the generic message.

Link: https://lore.kernel.org/linux-media/20211026194010.109029-1-u.kleine-koenig@pengutronix.de
Cc: linux-media@vger.kernel.org, kernel@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/tuners/tua9001.c

index 5e3625e75620653e80612888c7dc8156b0cda9e9..af7d5ea1f77ee810f2acf9010ca15c04132cab2a 100644 (file)
@@ -240,14 +240,10 @@ static int tua9001_remove(struct i2c_client *client)
                                   DVB_FRONTEND_COMPONENT_TUNER,
                                   TUA9001_CMD_CEN, 0);
                if (ret)
-                       goto err_kfree;
+                       dev_err(&client->dev, "Tuner disable failed (%pe)\n", ERR_PTR(ret));
        }
        kfree(dev);
        return 0;
-err_kfree:
-       kfree(dev);
-       dev_dbg(&client->dev, "failed=%d\n", ret);
-       return ret;
 }
 
 static const struct i2c_device_id tua9001_id_table[] = {