lkml.org 
[lkml]   [2023]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 01/13] net: ravb: Check return value of reset_control_deassert()
From
Date
On 11/20/23 11:45 AM, Claudiu wrote:

> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> reset_control_deassert() could return an error. Some devices cannot work
> if reset signal de-assert operation fails. To avoid this check the return
> code of reset_control_deassert() in ravb_probe() and take proper action.
>
> Fixes: 0d13a1a464a0 ("ravb: Add reset support")
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
> drivers/net/ethernet/renesas/ravb_main.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index c70cff80cc99..342978bdbd7e 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -2645,7 +2645,12 @@ static int ravb_probe(struct platform_device *pdev)
> ndev->features = info->net_features;
> ndev->hw_features = info->net_hw_features;
>
> - reset_control_deassert(rstc);
> + error = reset_control_deassert(rstc);
> + if (error) {
> + free_netdev(ndev);
> + return error;

No, please use *goto* here. And please fix up the order of statements under
the out_release label before doing that.

[...]

MBR, Sergey

\
 
 \ /
  Last update: 2023-11-20 20:04    [W:0.266 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site