From patchwork Thu Nov 30 07:26:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13474113 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 27F75C07CA9 for ; Thu, 30 Nov 2023 07:26:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C63910E0A7; Thu, 30 Nov 2023 07:26:37 +0000 (UTC) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by gabe.freedesktop.org (Postfix) with ESMTPS id A86CB10E0A7 for ; Thu, 30 Nov 2023 07:26:35 +0000 (UTC) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-332e7630a9dso450533f8f.1 for ; Wed, 29 Nov 2023 23:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701329194; x=1701933994; darn=lists.freedesktop.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=fxfaT7Lx/SLvMXZ8BIazUPMWfseGLyrbhSm3CqW4/u4=; b=vuKGpcy9eJnfs2PHUX8kZs+1G5qZ/ye90yZzOqonog40+FNzA3Oa+FUrzZRYEPRl+V w+JUfXiTmA6wrZNjZEyPRBqJRNGqZ8iyBRA3RWOZWDUcO1yeu7YjZrcTmocW4xpe9h8e TiqDSB/dROQz+e2KqALAfvpgg3zZFZRz6zqcdoLEzQJftUz9ZhE1eUg3nDxLAm0T3NXx KAFLoL0WhX+oiZLCt4Uib4ZFXHoAywUDv6rRRya0lbRH0nsws+12GhzjzTdSMW/1J7S8 up/iFe4wgkrda8VLn3QzDAGPuFEmAKmhEiba4aSSNSmoY2YyWV4jI3PJXw1WXGuRQDHZ 69lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701329194; x=1701933994; 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=fxfaT7Lx/SLvMXZ8BIazUPMWfseGLyrbhSm3CqW4/u4=; b=bPWcdzRLL7AslQ7rhTt4CoMwdqGVyEL/8tglV7KtHhSQHva3ZHzTYdSNvpaGOXxLvZ oE5XoY+0LC7UkW636bu0SZQRgB5G2Z4RxZZ5rih7gcr75DJUuqhM4/Mz4Aoy8CwnE+3E XmzNiVaGsFDDweQZoEfM4BnfRtX/Y12hJq8a2BMhpIjuJ6YKgMXEM/UPI6OhtoBNa2p3 Ml+kVfXODbv16ee/Yn4LM2xg1+scglHG8lVEfcSUE37CTtPRO8qe8VFvIJKTqGX4nOaz Sb8Sd5jBZuWHPESlMG+tAiTI7idXUzxSF/kLc/9WomLFK2Cq36GSQFYLQJMDlqSFJWBO GkZw== X-Gm-Message-State: AOJu0Yz0Sa/7bqTb6jO3krq5aCxobvds4rZSxBU59L+D2+eFBvq4cnEL W/oHXv0V3Pn51XKscQ3j05SIrQ== X-Google-Smtp-Source: AGHT+IEvR5GCRaBK6/l20FiBKNUdxPm6IPz8FnTeJNAeTaKjXHHuuKIh2lHQQWfzA51hiC4R/SwnJw== X-Received: by 2002:adf:f88c:0:b0:319:7c0f:d920 with SMTP id u12-20020adff88c000000b003197c0fd920mr14168970wrp.57.1701329194008; Wed, 29 Nov 2023 23:26:34 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id c6-20020a5d4cc6000000b00332f82265b8sm702358wrt.4.2023.11.29.23.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:26:33 -0800 (PST) Date: Thu, 30 Nov 2023 10:26:29 +0300 From: Dan Carpenter To: Sarah Walker Subject: [PATCH 1/2] drm/imagination: Fix error codes in pvr_device_clk_init() Message-ID: <1649c66b-3eea-40d2-9687-592124f968cf@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard , Matt Coster , Donald Robson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is a cut and paste error so this code returns the wrong variable. Fixes: 1f88f017e649 ("drm/imagination: Get GPU resources") Signed-off-by: Dan Carpenter Reviewed-by: Frank Binns --- drivers/gpu/drm/imagination/pvr_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c index 8499becf4fbb..e1dcc4e42087 100644 --- a/drivers/gpu/drm/imagination/pvr_device.c +++ b/drivers/gpu/drm/imagination/pvr_device.c @@ -105,12 +105,12 @@ static int pvr_device_clk_init(struct pvr_device *pvr_dev) sys_clk = devm_clk_get_optional(drm_dev->dev, "sys"); if (IS_ERR(sys_clk)) - return dev_err_probe(drm_dev->dev, PTR_ERR(core_clk), + return dev_err_probe(drm_dev->dev, PTR_ERR(sys_clk), "failed to get sys clock\n"); mem_clk = devm_clk_get_optional(drm_dev->dev, "mem"); if (IS_ERR(mem_clk)) - return dev_err_probe(drm_dev->dev, PTR_ERR(core_clk), + return dev_err_probe(drm_dev->dev, PTR_ERR(mem_clk), "failed to get mem clock\n"); pvr_dev->core_clk = core_clk; From patchwork Thu Nov 30 07:27:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13474114 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 4600CC10DC2 for ; Thu, 30 Nov 2023 07:27:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 722DE10E6C0; Thu, 30 Nov 2023 07:27:09 +0000 (UTC) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by gabe.freedesktop.org (Postfix) with ESMTPS id E901610E6C0 for ; Thu, 30 Nov 2023 07:27:06 +0000 (UTC) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-333229dcebdso192663f8f.0 for ; Wed, 29 Nov 2023 23:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701329225; x=1701934025; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=x09g6G18OJ4KcEcTHhYJRdvLAtb4UmkCF9sOQ3/Txus=; b=Nq2XqC5+euHKPtWeY40+WG5LSddBzd8Qgzxu/r4YuBKAoxbnMrraXysWnRzYaLSVWu HpmWPYkn6Xq3Rx7u0gi32BP22WMrtXrRz8DYHA8aN9AKiU2exEOtkS3XRYusW27dNY+z uAjifNt7WyTS8EX/9m65VsnaaFR7zIedqLSmeY76vjQXz0FbHRM3K84q1Ns2NrfwfjRg oxjfQsBqOfPG20ss/xi+9oUZiOC7JRbN8zsBRPcZVcGkLKZjljHc2QJg+6YmvCGKW7F6 zkbL0bStzvMkttp9WejuzXO+BVhq4YPIDsDvWCrdpUQoEHRz8kX04xeR29s43ICqEXea L0Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701329225; x=1701934025; h=in-reply-to: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=x09g6G18OJ4KcEcTHhYJRdvLAtb4UmkCF9sOQ3/Txus=; b=OuMLG2SuZyCUebYGJavBDOTsR5NJFxhBelPa1MgUhplSJzNY7Ftnk0VCmowmorwSGM cnSdcgY9pTD87nE61THt0rP3Fejwafj8zqEGzgjvD++49DVj9bTRCuL53OAv4CyQG2oR fFP6YUDEjb1X2iZqAIKSX4xmOOJuoYxKTxwiyGnn0QFp9eXdQppLWS2fuuyTh1b8adpd hNIfr+huv5JsUo51G/o0tVKsxrH46seWVAaHduJT2wSde0eU64eTfxN1paSZDEC2xr5G HpWqyRV76Hc5osuCbBqtL3/2BJpuNMT3YnBMOqbXABbbYwYVvcA7yKoi22PNr5L/sSbr rzXg== X-Gm-Message-State: AOJu0YynHghw9+5BEDKOfKK6xJB2JHn2JQUMEUFkdheyWfsjXXINQOeZ cKbdBA+wpSWo/vzbPBHLEueQ0A== X-Google-Smtp-Source: AGHT+IEPpmMxWY7kuPeVsp/4wZTQWAaoK7shEBxCxTgQhdfynB/VG26OKEMXa8H2xecLoUqmGYdG9A== X-Received: by 2002:a5d:5987:0:b0:333:145c:ac01 with SMTP id n7-20020a5d5987000000b00333145cac01mr4260949wri.44.1701329225311; Wed, 29 Nov 2023 23:27:05 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id w18-20020a5d6092000000b003142e438e8csm693983wrt.26.2023.11.29.23.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:27:04 -0800 (PST) Date: Thu, 30 Nov 2023 10:27:01 +0300 From: Dan Carpenter To: Sarah Walker Subject: [PATCH 2/2] drm/imagination: Fix IS_ERR() vs NULL bug in pvr_request_firmware() Message-ID: <384288de-a779-46c7-869d-b3c63462e12b@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1649c66b-3eea-40d2-9687-592124f968cf@moroto.mountain> X-Mailer: git-send-email haha only kidding X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard , Matt Coster , Donald Robson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The pvr_build_firmware_filename() function returns NULL on error. It doesn't return error pointers. Fixes: f99f5f3ea7ef ("drm/imagination: Add GPU ID parsing and firmware loading") Signed-off-by: Dan Carpenter Reviewed-by: Frank Binns --- drivers/gpu/drm/imagination/pvr_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c index e1dcc4e42087..5389aea7ff21 100644 --- a/drivers/gpu/drm/imagination/pvr_device.c +++ b/drivers/gpu/drm/imagination/pvr_device.c @@ -286,8 +286,8 @@ pvr_request_firmware(struct pvr_device *pvr_dev) filename = pvr_build_firmware_filename(pvr_dev, "powervr/rogue", PVR_FW_VERSION_MAJOR); - if (IS_ERR(filename)) - return PTR_ERR(filename); + if (!filename) + return -ENOMEM; /* * This function takes a copy of &filename, meaning we can free our