Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1144833iog; Sat, 25 Jun 2022 02:02:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sryi6mpnCz1p4lO66GHqpNCn4CrMF9+c6RoBvE/sqNfmWsoXRq7ymd+V0iK9gPmMcnETir X-Received: by 2002:a17:906:2b84:b0:718:6034:7562 with SMTP id m4-20020a1709062b8400b0071860347562mr2985978ejg.288.1656147753050; Sat, 25 Jun 2022 02:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656147753; cv=none; d=google.com; s=arc-20160816; b=QwTSpnakd+9o0p6CmBWbnppjgq75PRYYM55PIY3cy1ScTOSNANylL/RVhBiLxjDQGx h4+hqE87nW7I4Ne6DSZ5zGfd64HfNqE8pcf8GzilXSHtAsGVUDtTczHR/hXsiopPpxEt gW9IeqaaCz7/nUYKe5DACEglLiwNNkT4poMEeUxvBeaxks6JMQ6akbanKaG/YEOB1zJQ MOWsLGxjBWKIDcM6qAgDqO62ZpIwx9Untsl9tEMNsjCH6gt+kb82mrjp7JXafMe2X2a2 YLR95zBL6AsE3Ws2JtHTpF0NWiNQXzwhi4Kq2jkB1jdkn1o/oKvPy4RorVP0+C8qIRw7 Qa6w== 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 :message-id:date:subject:cc:to:from; bh=ZE/gw1XuvNP4SC2lqLW0uzU93lALLNVvCRu1NKd3of4=; b=YXL/BeAdNfpHuNvvS+PI4UQdbbv1HTBidRHMyYui5Oqrh96pkDnkgENepTfP10F8nN teTTBR6fr3vQBcrMbI9+z1L1pVHb3xM1BmSukpEoRnwnq6CDJVq0pkj3dGvHgn0KfQJd qAcKiGStPbaEs0Vwv76YxRkIi8jyVu/Yvg4BesznSYyg8J3XH8l9R9tfRg6i1u+9X3JF v0XP0I3kUZjakoze1PaxB5fYHClhAwtfC5i6b0rcxJfoJQzlSKicAFKBquIZZWvpHTjU WKt+3s1m3hd2knVTrJ24Vsf7iThqdv9wir3JILgUoC2UIIdUJEoXdIHO7Nu06+8Wdrok QDNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji13-20020a170907980d00b00711dc66ba50si5059554ejc.937.2022.06.25.02.02.07; Sat, 25 Jun 2022 02:02:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232261AbiFYIhl (ORCPT + 99 others); Sat, 25 Jun 2022 04:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbiFYIhk (ORCPT ); Sat, 25 Jun 2022 04:37:40 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3C3337ABF; Sat, 25 Jun 2022 01:37:38 -0700 (PDT) Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M3DBd-1o6OCq1Hif-003aCA; Sat, 25 Jun 2022 10:37:21 +0200 From: Stefan Wahren To: Florian Fainelli , Michael Turquette , Stephen Boyd Cc: bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate Date: Sat, 25 Jun 2022 10:36:43 +0200 Message-Id: <20220625083643.4012-1-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:Vy6icAiczF0gw0MoXatbk2jXhrSuQ7VJMzuHmw0S6CNnF5C1W5Z Agav/V+gv8xK47eb0kYjJuh7ANFjFg6yE6t29NIk37gM7sgslw1fuMkH8rFWV0im+Mm8uvO TgA+Inxv9MxfR0oHG/XcD6p8mN0z6svksrTveZc+hgcHAqp83VguIR0UUMNfNihO4TLeAuk KNPAg8sHJlV51kcwjg7DA== X-UI-Out-Filterresults: notjunk:1;V03:K0:Stru1JlMmJ0=:gfTZrHPcEAVKnTCpULi1sm GK/p9GY678WyqGGjQF0Vf2EcsNrK4BHkLrfPveBN8jKBvGXrRrsaeNjmpPipvXvM4GN3qrP2Q ha9toybsFXWHVLvXGUSD99fDb29YWRmVDCooAqmsOkC+92w7/3xfyVC8SArdoflhtxX3Yx++m Og71tBBdIF9V7m1UCHv7LvZpawGtivezMkEFRA1KiOykjE0hy8NpsVb7LF6xgT3KU/Ou2f0zC Q8SULZ60Ss1iZFkZexnl5Rurkagijt/wDd7y3WqdVIfAnieZe1r9hVvj2RGdJDwi+hQBDPyby wlP7N24XiiSAb04TaMuIu/MxiRunE5JP+H2A9bzdB7jgwPRrJAJLzaaQF0ys6zEGSbWn1TmDh Tyn6gFZSwaTT3f5FQM01z2beXbjt9wOJHyIyl+VXNAWyUAbHyyq2WMRTP0HnXan3ol3ffTEkw q09DDoeZEZ7BGWPPZudCwpYwFjRbRPEUjh7pi+SafTo8VUuAbycz1FXjgn3s9yBInQ4nxB+5C I3xg21uX366vbd+CEQKjvkOOpTBV8kTBpdebRlbS4+9h2BQZF02jjnhcThGH/Cq48+J10X9Y9 V0A/kMEaXwoqfIuqxnMO+cCvOJILEhH6q4bPPhIBJ93caTPCFYDidtTlasDmf6XQjFj44AgnD AfM/m1iMXqipBm4v0U9zqXUNedql+pVHbj8A9doeQm6Ik9hNT2pJbx11Sdj6STd4EXGApJJ5T RaBjKU3FqR3pqxJ5zFtjoVdvP3fSbwKY5KzWwh1GlaEadXfzJdLiHIxvLmc= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 The function raspberrypi_fw_get_rate (e.g. used for the recalc_rate hook) can fail to get the clock rate from the firmware. In this case we cannot return a signed error value, which would be casted to unsigned long. Fix this by returning 0 instead. Signed-off-by: Stefan Wahren --- drivers/clk/bcm/clk-raspberrypi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c index 73518009a0f2..39d63c983d62 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -203,7 +203,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw, ret = raspberrypi_clock_property(rpi->firmware, data, RPI_FIRMWARE_GET_CLOCK_RATE, &val); if (ret) - return ret; + return 0; return val; } -- 2.25.1