From patchwork Wed Apr 24 11:40:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13641762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 447B6C07E8E for ; Wed, 24 Apr 2024 11:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=b3Z8+p6Uz7PuODF+Fn797GxeVDN/ooAYFUy0Rk7C0Us=; b=1TmcKTJjxzAFnv hUoCq6AsmxGHOaNTzeHj2ft0hNbDIo7HGrXF+RsJrW8Q/a1Q+aZKTACk3FJw4mu74cFpgj5KOefkQ SIU7sJ/J85/4D+tCsEDhuA38lmsDrHcOPAJ38EIUI0ksjDojzX2WRZ+9ZtiqFq9aUtxxHsdtgjG1p 136p3y9GVlR3P3lPjs8QhFeIfDaxCjU4sA8pzMc0edB4NwP55hQlOk9cMjSykTrF0KhkgsMVuJ7um ZcDYBRAw5bcl0BZDIv9HtrIaN0VcZV5EyENKiitucZIxg0iwTkgH3YecMonEkY+Dyfej4yBU3VEKe eCrnqS4Zg/VfczOwQ0YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzazC-00000003w70-2kgA; Wed, 24 Apr 2024 11:40:26 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzaz7-00000003w6L-1hon for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2024 11:40:22 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3465921600dso5993091f8f.3 for ; Wed, 24 Apr 2024 04:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713958817; x=1714563617; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=lWMfbfXnYK3fqv0yrgeedC9giNqOZfecY/EM1i6Y9pw=; b=dLlQ4YZb8l2C8TEBJpEt6jZ2KhQ/lrWYfspiZtiv7O1BfwXiC9Nr2iRH4HQh6D5mwg EykOYFhXtiUCWnsI+N2hmATFikxRKUiqkfZtDA1xJnm6271ReE1Ml1AcY1akNYlkMtE5 b7OTTnl79SxsRuRH58TFYy6S8pri45YcwBWgwoV65dpRl+FmvyhdPjxyaactfmQM5Fqq P1GIEZdfoXjo9y+m8LDOFfxpO1PRPlHyHQz4ohu2Cp2yE7iSVEt9AAokN7X4d1Tm7I0c j/OyIIliZ9w/clKxdZTzvAYNhZDMa/nILfSuSvqgOvGLWEqBUzll++zNXv5pZRDtWPVS 88nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713958817; x=1714563617; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lWMfbfXnYK3fqv0yrgeedC9giNqOZfecY/EM1i6Y9pw=; b=qR61zy6WRbZ4UQWru3wORAgSONjNecEqNiDvCq6BEz1oKPhLs/S49SpCiOS70auVu8 Ug47ePzHW/3TlB/bGSxt8/rEunL1O8ZMWWYmimiXnLoDLX1Nlv8rYdc8atOxqWPezZ0W XTdvHmZ/QtvYBkR72cJCZyZOe9gW8mjOq+lV9iGhY6ZoDo6hB3lELAEgMZXawpSIm9q4 3z0e/gEuA97PvyeokS0JKHK2yLXevz48IQZ+ocma8px7UNwAaF7InP/apiiLakrbzCDS 0Te/cLrMMV7Ys27APxaEkoyStq8+Pz5RxjJfryROa8KuFEQfYh1aWOb1hhuChb67wPCj KgWA== X-Forwarded-Encrypted: i=1; AJvYcCXK6pwTaHNql3S5VKmwnqYPI6deajd4ozQ4e/37AX4ERYw+7Bg7cpMInaCBXUhvYju6qj08vaRWeVtpJjcPd0GN7NIYNdd1u7D1H7gK8gQoC9z3Haw= X-Gm-Message-State: AOJu0YxaQsuuoKbCA1xUri/YKQGzjvseRrXA3ndqp0Smo5txjbOdicqv suVoPCJmqzzUsXdPgTxbkmgkYN0qf8eOETi1EpSW+lb1pV2LN8HwRgSxNJJ3Kf8= X-Google-Smtp-Source: AGHT+IEWJT/8VK6y4z/3yPVqZFVfOmJf5zYfnoJ8CK24bfiYAkNVefNagGs454ZH+JH0euJmK90N9w== X-Received: by 2002:a5d:568d:0:b0:34a:9b75:cb95 with SMTP id f13-20020a5d568d000000b0034a9b75cb95mr1449964wrv.37.1713958816645; Wed, 24 Apr 2024 04:40:16 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id d4-20020adfe2c4000000b0034a3a0a753asm15306805wrj.100.2024.04.24.04.40.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 04:40:16 -0700 (PDT) Date: Wed, 24 Apr 2024 14:40:11 +0300 From: Dan Carpenter To: Andre Przywara Cc: Yangtao Li , "Rafael J. Wysocki" , Viresh Kumar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] cpufreq: sun50i: fix error returns in dt_has_supported_hw() Message-ID: <9bfe5703-b39b-4d98-9995-f6a7d0ea558d@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240424_044021_577980_1183BC8F X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The dt_has_supported_hw() function returns type bool. That means these negative error codes are cast to true but the function should return false instead. Fixes: fa5aec9561cf ("cpufreq: sun50i: Add support for opp_supported_hw") Signed-off-by: Dan Carpenter Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec --- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index cd50cea16a87..0b882765cd66 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -136,11 +136,11 @@ static bool dt_has_supported_hw(void) cpu_dev = get_cpu_device(0); if (!cpu_dev) - return -ENODEV; + return false; np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); if (!np) - return -ENOENT; + return false; for_each_child_of_node(np, opp) { if (of_find_property(opp, "opp-supported-hw", NULL)) {