Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp118446rdb; Wed, 29 Nov 2023 23:12:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpIHakVA3re0LE5/IgqYP8iAYv0U2dPel6uxKAxwBrATdbvBd94GTdKFhx3mQ+UEJCFIL0 X-Received: by 2002:a05:6a20:4388:b0:18b:30d1:8140 with SMTP id i8-20020a056a20438800b0018b30d18140mr25089634pzl.6.1701328370318; Wed, 29 Nov 2023 23:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701328370; cv=none; d=google.com; s=arc-20160816; b=rTXCQCDG2Tn+/jmK1IgrX/Dh22N2UmNi1NGm5maKLNaxjXOQTzG1CVn8ZYQmjCF9n0 5NRLO5FHSzMR/h/EHMYnXvvkufTH5djnrWhYm7xAlI+0fFK6BqE1n1AXV1F4UgvdZQ4j Vri2EviNTf1ih6qJOk1dSeTbjC5Mk+2yksVfZjl2sgYkQUT/kk7n/JGm9fX1hOR8eNaT ICgnGZeUc2YLVmrpg2Y4uKWJOHq99zoG+bI9zQA9lXulCIBAOfb8VX7QxfLJoxZhvQSb RYv7tRI96L5rQRg+G7SeMywZiRt5QA1LHIENaEWBYGWByUQO8JJWh7fSbml0PJQQVzH+ bo+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f1Odgh8NQ+ymmAyVzkExaOV4kNSDq/6wv5PLiqzNFYg=; fh=+jwocpIEcpU4tee9Medy6FcgWbHkCjESAH5riVYuYu0=; b=TsElGeW6twkkpvGzFWOaFlQyGP7NJuB1wOzkwKH2LWkh+7PKp5H02KXPOwDc2hDcxf YuJJ14/F3Iy+7DGExH0gXtngSgCPqEntV0hDBWG6HtwqXy1MAfC82Ywj+vWDo3/qIky6 KpqMKyLoXDD5tMGGlhUxLPL1Zu5p5xzWoLzfAJAUauEx2fL4JnuhQnl/vc2WkvVEhDzX 1tSqib7+WV6BycEpCkAd33IwSqCOwpgtzIS6NRDNrE4Wn1hzaEWEzq4Ik0+dxFsgFadc v4mitaoc0wVIiC5lnZ8aHdWjsbF+G5CpsltJo3s9MWvqSaSIr80cmd1IybkSwfFrfMVv 6hhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=MPzl9jCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s21-20020a63d055000000b005c16f26b1b4si667020pgi.440.2023.11.29.23.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:12:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=MPzl9jCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 62192809871D; Mon, 27 Nov 2023 01:04:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232659AbjK0JEl (ORCPT + 99 others); Mon, 27 Nov 2023 04:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232607AbjK0JEh (ORCPT ); Mon, 27 Nov 2023 04:04:37 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC25E184 for ; Mon, 27 Nov 2023 01:04:43 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a0029289b1bso539135466b.1 for ; Mon, 27 Nov 2023 01:04:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1701075882; x=1701680682; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f1Odgh8NQ+ymmAyVzkExaOV4kNSDq/6wv5PLiqzNFYg=; b=MPzl9jCxhIUN6DjkTUK94dkPbCkWZ1DjnfDjx6uOOvWT6PjCae5EzmolsWinzmZaDz K2Vixs6mgTPcu+u670olQFdDmbWA0nZf3A+wb15aMQc26Ga6DmyI6Yc1617gtHzxCf0o 0Is6WO1rNR1GkZUxprIeqIGRu8ftoxs3D64nP4hGBzj+S/IcDIOlZp+UEJSPHCdoFdpm mttuZ05PnlSdRjjgPNxCtYtOQc/ivHVlSifejBhvbGzOOMMcz880QivPgMcWeACWCYmI IeBip2veRpGlkuGCRxiGYxyAFLZ/CjYkq8CzC13J7MlOe+FyIdyu2owObzrm77AuHCXI cItw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701075882; x=1701680682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f1Odgh8NQ+ymmAyVzkExaOV4kNSDq/6wv5PLiqzNFYg=; b=K+F9mq6/5/0zSHcggZ6CnoWiE6atJhA3pZLzZl23jcndn1HqyvrMQYgWSZYfZM1D3O mpteteueb++SHwHhbdWLWswi0EUQZadCOSSYCYSLQwHHOp0w6Qk2rfbGjCcrUgF9UU7W WMxe6QVmIyFHTEj7h6b/a0hAbO4VyEYzp+LXH5N+gDObrcW/sK6bQIO6a5uaZ+PtyQ1f RR/t5KCG20BE31GbSu0u0c1Sx7Qfk4LML++xY5Jz0BVubUgOQnDA6Cj8Q/QGfk6A9SDF EaeRGZ3192gdaJMrZXydmkamIfQLvUEqdJgqbDvfi47BreA+qX5ecsSqrExZ3wirJ/yN zftQ== X-Gm-Message-State: AOJu0YyG+l6VRCd9QyN26GwFceF2a+ZqTzEZUHmP2kBrozDVIQD0ByP2 Q4m6Dti7+2bmTZU8N/tLLQhIAg== X-Received: by 2002:a17:906:10d:b0:a00:2686:6b40 with SMTP id 13-20020a170906010d00b00a0026866b40mr6513858eje.14.1701075882183; Mon, 27 Nov 2023 01:04:42 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.125]) by smtp.gmail.com with ESMTPSA id ay14-20020a170906d28e00b009fad1dfe472sm5456539ejb.153.2023.11.27.01.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 01:04:41 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, p.zabel@pengutronix.de, yoshihiro.shimoda.uh@renesas.com, geert+renesas@glider.be, wsa+renesas@sang-engineering.com, robh@kernel.org, biju.das.jz@bp.renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com, mitsuhiro.kimura.kc@renesas.com, masaru.nagai.vx@renesas.com Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea Subject: [PATCH 1/6] net: ravb: Check return value of reset_control_deassert() Date: Mon, 27 Nov 2023 11:04:21 +0200 Message-Id: <20231127090426.3761729-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231127090426.3761729-1-claudiu.beznea.uj@bp.renesas.com> References: <20231127090426.3761729-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 01:04:55 -0800 (PST) From: Claudiu Beznea 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 --- Changes since [1]: - added goto label for free_netdev() [1] https://lore.kernel.org/all/20231120084606.4083194-1-claudiu.beznea.uj@bp.renesas.com/ drivers/net/ethernet/renesas/ravb_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index c70cff80cc99..50c4c79be035 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2645,7 +2645,10 @@ 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) + goto out_free_netdev; + pm_runtime_enable(&pdev->dev); pm_runtime_get_sync(&pdev->dev); @@ -2872,11 +2875,11 @@ static int ravb_probe(struct platform_device *pdev) out_disable_refclk: clk_disable_unprepare(priv->refclk); out_release: - free_netdev(ndev); - pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); reset_control_assert(rstc); +out_free_netdev: + free_netdev(ndev); return error; } -- 2.39.2