Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4373054rdh; Tue, 28 Nov 2023 22:20:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEO8ELG3Kr3H2s2QaM4CCZI23H1QNXlfk8rbkY7DT7ONUXyv8t7zTWU7ik6ikyoa6Nu9so X-Received: by 2002:a05:6358:63a2:b0:169:a186:dc7e with SMTP id k34-20020a05635863a200b00169a186dc7emr14678866rwh.12.1701238825084; Tue, 28 Nov 2023 22:20:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701238825; cv=none; d=google.com; s=arc-20160816; b=MZkJUXqcwYgFU8QHPQhc+kXVKBEfnCvSYumyRsEDceYnndfCIs9gw6TAvHb2Q7u+S+ 2JmFPZZM0+M0KaHMm8N0bgHqCvuY0MDR4yyF82RtERuqZXnvXcbwm4B3RTm3HML/5YW+ rZxpjj91RsWe+yBt9EIen1oJP4pKi4zz22jrUy1rT2KHXd9syMOw5kvevKVXYfJNoeeV x+ffh23oEeTYw896G36LogTVFfN/g0N/ijBNknSmZwEF9HQLaKbgWShmSd3dUIvCWc9E btTvASLwGr3o4Lvgsp5t9BGltQ0txu1jCCrEzvfU5MDZ4+zY15HLBt4peCz8eMx56y2T DvXQ== 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=tex/f+v5XiThmeQ/1yf1Rnsid+DeltBdSjavRwGvUE0=; fh=0TmBxb3iK+HPjRlYDVXDLy5dPQUGD9gLiQry0et3j2E=; b=RIW1erMMLXYav6/LKcZnrdn2pVeZgWmw3gbbYZxK+vKk+47bBlX8fKpSMR5SxYA+Sc WeHKVX1mPH1EvnQaISd+e5tkAL0E6VOrYIIYtsnc/iY34/+G/hZJBjKzziDTNS1i/Ecc JCIMT3jkbpQrexO499Z0frmh77tLAztkue4DZ/Z5On6v+fYh6ve+PLPGEg//zlNtRb1M 85PdSRjxoyA+2VMgDinx7HOu3SDyo1llACx78Wq6QeAv+ZOjA/hwGJf0JOWUvHWu+YXa GcTAOaE5lZDUB3uER8ayRUPvMrQaSzhgIu6YY1jcmFUEbe+AevugchglqOEr9/bpfeBt jCtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=BhSlTlws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id y7-20020a634b07000000b00578ea9a0b93si13706119pga.890.2023.11.28.22.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 22:20:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=BhSlTlws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 1A98F807EB16; Tue, 28 Nov 2023 00:05:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343960AbjK1IEu (ORCPT + 99 others); Tue, 28 Nov 2023 03:04:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343962AbjK1IEk (ORCPT ); Tue, 28 Nov 2023 03:04:40 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 585FAB6 for ; Tue, 28 Nov 2023 00:04:46 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40b479b9c35so11959455e9.1 for ; Tue, 28 Nov 2023 00:04:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1701158685; x=1701763485; 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=tex/f+v5XiThmeQ/1yf1Rnsid+DeltBdSjavRwGvUE0=; b=BhSlTlwsDX7EXSCG+VX6B79BvgoXHd3U8a/cpeGFbEjaV2osMCqUhL1pl4XF9LE0bQ iPwiKRrjO2grjbrzsg8VG4nqHOJRJGP8BDCO0SuLC0xuWcG/MGsCJrry6FTYGfFBFkQe rhCsCs8vcXl7YB+XR+OVZp8Nkz4hPDab+7zPn6DtAlpGmXmseDlEjry+8DyTE3Q0SRDF S01ZUwc8WvTwJsfEi6HLvdLa7IxdUoKiMm+gnW1DcEkdwk94w/vERWZyR/S8VCyshEvl UuKsydZip5vsibo/rNvTIu6QW2BxwpZd5MSQ4vy2tMxbcx4TDYCDdrLVv/+t7poAAXr/ bhdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701158685; x=1701763485; 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=tex/f+v5XiThmeQ/1yf1Rnsid+DeltBdSjavRwGvUE0=; b=nmy+s/LV6D//B7W+CQ5tQvXOHy3FD0aztCBQvBDmala4WI25bjub0WuNGL0CxbawMk 0j6sdA59ZH5z7Rt4hF4JOCQ7sRSgQX1ANeoQ+lzLJsYs5BYfSxqMiuANWJGBpHjY4JEB Mzzq+rZe1H8q5ltmR/Olmph4eYB2R0nu3t3OC7riXJGBek7tPaTxvTntfmjfBZ2qZSwx L7NUdsYCFFNSWBzAEOMQ7dJz2n0UADl40hLoumzcNxLDApWR78HAMW2hQ9goJSLch5wu 988ChgauJYUa5nbL4JnW05iNOoJVqDujXBZPPOT33mP6Hd4e2XHLwlMFuU1aLd6TD/SI iRAw== X-Gm-Message-State: AOJu0Yzfg+bI2B45y76eWOb9vC3xYTFK0OiTK/02cfOQ1nvPWOyjEDG4 CZWb+8h0jPevsEQbbXWplLVmAw== X-Received: by 2002:a05:600c:1381:b0:405:3455:e1a3 with SMTP id u1-20020a05600c138100b004053455e1a3mr9383229wmf.17.1701158684750; Tue, 28 Nov 2023 00:04:44 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.125]) by smtp.gmail.com with ESMTPSA id g18-20020a05600c4ed200b0040b4ccdcffbsm1127534wmq.2.2023.11.28.00.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:04:44 -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, 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 Subject: [PATCH v2 2/6] net: ravb: Use pm_runtime_resume_and_get() Date: Tue, 28 Nov 2023 10:04:35 +0200 Message-Id: <20231128080439.852467-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231128080439.852467-1-claudiu.beznea.uj@bp.renesas.com> References: <20231128080439.852467-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:05:28 -0800 (PST) From: Claudiu Beznea pm_runtime_get_sync() may return an error. In case it returns with an error dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get() takes care of this. Thus use it. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergey Shtylyov Signed-off-by: Claudiu Beznea --- Changes in v2: - s/out_runtime_disable/out_rpm_disable - collected Rb tag Changes since [1]: - added goto label for pm_runtime_disable(); with this innecessary changes were removed [1] https://lore.kernel.org/all/20231120084606.4083194-1-claudiu.beznea.uj@bp.renesas.com/ drivers/net/ethernet/renesas/ravb_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 50c4c79be035..0af2ace286be 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2650,7 +2650,9 @@ static int ravb_probe(struct platform_device *pdev) goto out_free_netdev; pm_runtime_enable(&pdev->dev); - pm_runtime_get_sync(&pdev->dev); + error = pm_runtime_resume_and_get(&pdev->dev); + if (error < 0) + goto out_rpm_disable; if (info->multi_irqs) { if (info->err_mgmt_irqs) @@ -2876,6 +2878,7 @@ static int ravb_probe(struct platform_device *pdev) clk_disable_unprepare(priv->refclk); out_release: pm_runtime_put(&pdev->dev); +out_rpm_disable: pm_runtime_disable(&pdev->dev); reset_control_assert(rstc); out_free_netdev: -- 2.39.2