From patchwork Sat Jan 4 20:54:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13926358 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E9B118A6CF for ; Sat, 4 Jan 2025 20:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024085; cv=none; b=UtZN/7IaCDTJSRVhAKvj4giRRHePZlRkXvmlvje+F7uzOH+BhGI5tGTF9JeRKsL2rcbmMDPkFWIGLoj+ZF9CEHR5ZLzNL8VdG6PNxXDAtSqGxnzhY9uvAEvpI++kcE3kxAnQy2jnbVgUiB1VUTN1eNCSDvOx3Hev9xypbJaVwaA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024085; c=relaxed/simple; bh=fYNFkZ4E49jBh8K15pvFiL/fAUn0j4KNd1uS/SNnNLc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ehBMi5GMchHotTCZ/Rv5V6tNd0LaKxi9Ly13eaBbAt0cmd2bEhZqbL7hMYo1PrfICi3Z4xd2utLvIIfixanzjIh2Kt8WWWeTyMFguIQC/yj2lPgnqQf8CXSknJ032t790fwdjEN9IOOJ3hwDypk8ypJ7W9ZKZsNnSXK08oxveww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=f+CxS3Fs; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f+CxS3Fs" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5d3e5c225aaso2819963a12.3 for ; Sat, 04 Jan 2025 12:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736024082; x=1736628882; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BMnEf52UfAT7r8nhxUJ27WGRgof8roegZaPYvjI6+Zo=; b=f+CxS3FstA746ECg9npg4+CiwW5WlafE12tuQam5CYW0TdFKRhBfbQLd8RD6s4gfl7 Nd7h7dVqIncK8pygkk/z7eVV19BlwVZAYZ0AcIDG6cfdB8qHlKcbxZ2nv9Har/TPgH+F 26hBP4L7bh6Vk808mIEjhII5fsKHUxyFu/caELwVAfhBqLDD/3dAg7SxajJPNK2rkqtK EUq6/cUh7VSgd/Pr9hkomoNjgwWoqPVAKmtyGvGtvnOEVvMO5Ncgp0EmbtFZB9nw7fGw cFCIZAyFWkL52JELQ+AvST7f3twucq45I5lqKiDI3P+W5Epz5l7KFf3zPqX7Myj/tLyf +oZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736024082; x=1736628882; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BMnEf52UfAT7r8nhxUJ27WGRgof8roegZaPYvjI6+Zo=; b=OPdXc9Q0d7Km7jy6F9672srNVXID5eIA4JljK6LfHSMC1xhuK5oHz71NGtXgOk1jaG 59aSWXxk0JCMTThPumPTXcxh/RbMzLp8RbDxVJNateSCxAmBM9Q9EAlDFrz1z8SAjMPf w3KlWz463kB66xRwtDdD7Z6jwgXwn2uKbHlNLFfBhz4sFVwFmN3j9/l6NZdNMVfsBn8B 4tIlkH/p4UkzUUrcAgnLkf8P5d/YJPhOtUzmdnWJDOxa+zpUrppOA54N0RE+9H14CtT/ cP1kjcX3V1tl8RVs3f46G5vyTyI6rREGUKgk7BnN8uSUtunjktlolTlwYk9BbIra1sz3 8ULQ== X-Forwarded-Encrypted: i=1; AJvYcCVxJfq+3Dx5QZKSEFdHuzsYqiSCgfXnoz8SughhKKUqziwYiAg88f0YIbPZzy8Zk1RwjHfYtWX+lk/spA==@vger.kernel.org X-Gm-Message-State: AOJu0Ywqn+NiYf7pqaU4kW2ZbBeXJ9Qm9Nk4qAHD/PJpjxx1Fpi7iOHx MsTgmklNF9JyCbayTs3MGIzZGrK3C8We3Y6iyXFVzbdR4RarXK1lePDsYh2zoQo= X-Gm-Gg: ASbGnctcpWYjZ+x8VXfTYnJ3rp4EbwgOPhrQw84x/C9+g0RNzuELMsGkeo2RtIUvnSU ijlceM4AsFIWikvfEuUvIXHNk+ivqNsfc/3hrZUxnGh/80sG6C41x4t2BTUijZeUwK8Yg0SiAcP yS4dR21xJMcJWFOVY8QB+xdKZr75xtxiz1prTkk6/12bF1oCvPXvJOBdBjLMps9QLCPM3rWJ3Kg aY1BA/vk9hV8/5TRJdciuKERjjJ9gNhjPVQOsmmwlIX2n7f9LBEQPWhGtGNZHydkxkSLzY= X-Google-Smtp-Source: AGHT+IFLOaiX+zI3DneKZWxfhc5l0F3vw+qCGBukNa5K0q1p/ZxNgoJYKPDQaaRdI+EszfqyaVTwdg== X-Received: by 2002:a05:6402:2801:b0:5d3:e79b:3b4f with SMTP id 4fb4d7f45d1cf-5d81de1695bmr17922824a12.8.1736024081142; Sat, 04 Jan 2025 12:54:41 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aaf4a841749sm839666666b.137.2025.01.04.12.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 12:54:40 -0800 (PST) From: Krzysztof Kozlowski To: Mark Brown , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , David Rhodes , Richard Fitzgerald , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, patches@opensource.cirrus.com Cc: Krzysztof Kozlowski Subject: [PATCH 1/4] spi: atmel-quadspi: Fix struct atmel_qspi_pcal kerneldoc Date: Sat, 4 Jan 2025 21:54:34 +0100 Message-ID: <20250104205437.184782-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Correct the typo in parameter name for 'struct atmel_qspi_pcal' kerneldoc and W=1 warnings: drivers/spi/atmel-quadspi.c:244: warning: Function parameter or struct member 'pclk_div' not described in 'atmel_qspi_pcal' drivers/spi/atmel-quadspi.c:244: warning: Excess struct member 'pclkdiv' description in 'atmel_qspi_pcal' Signed-off-by: Krzysztof Kozlowski --- drivers/spi/atmel-quadspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index f46da363574f..d135cca4e454 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -235,7 +235,7 @@ /** * struct atmel_qspi_pcal - Pad Calibration Clock Division * @pclk_rate: peripheral clock rate. - * @pclkdiv: calibration clock division. The clock applied to the calibration + * @pclk_div: calibration clock division. The clock applied to the calibration * cell is divided by pclkdiv + 1. */ struct atmel_qspi_pcal { From patchwork Sat Jan 4 20:54:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13926359 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8769A1D5CE5 for ; Sat, 4 Jan 2025 20:54:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024088; cv=none; b=HyN/sOBmqgHTEuB68i/K34HPX1QZw8S+UUX+sPEsfCeBGckNWTCNtXNqYB5esUDsmRTRH38qSxFkvJTT/r9EaX5nNGhbYZwOZoe3+8YaiGWB/8W5vJsv9mUvxIeSmhW7ExH5mS5vQzcmiHuNYRct9ItJxKzpe4Z6T+/q9lRnlv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024088; c=relaxed/simple; bh=0pluUhxj+qHekDTaDHHUWfvMX4R8WWXSMErhdppVD4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OAVwO8p7dR3P2MPPm3GmXWIVt2FPMx1VcWMSN/nJngjrqKaCBc8GDYN/vECEwC/TiTnY1fw6u2sj1vb2cxTc32o2W0s0JT5qq6jTfH8NTjj57T781mv/FVPUK6B9E175Cqe4TEG3qKUyCoPtu1j9YzRnPQ3tbhz5axh+Vn9CbQU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IpKWDkAi; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IpKWDkAi" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5d3e5c225aaso2819969a12.3 for ; Sat, 04 Jan 2025 12:54:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736024084; x=1736628884; 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=XLKX/DDFIRPvx5t6DaUjc92tk+3Aa7daTr762N5Ifkc=; b=IpKWDkAiY/Ttys+LjWLoxLoHZDs+pi3cu980+RD7Xi7kdylySfQRse2ik28rGbBCut wcIgmbbWU4pPHlHpYtGwTOBfgpgUo927OxMNebTOEJJYm0/JCBICliRZiRylZawj4c+k TYQ9Z8pTgn23p/mhZAip2AyGuPOSO5n6qWiD05YVgCyuX9/Cnu7JBxy31Gc9GoLSO7ez QyfLeJKYv2h3GnrWFHmav/NWnl8SP3zCipd5KTPwLU7NaX9vQeYRWcyoJ4HrL4GeuyUJ bMDbRyjnFzVNEqL16q1Dn1Bh4z98C/9mHvrFhwgcgZTIan+r9j0jq7pXsVrnkhVSpyiT fUqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736024084; x=1736628884; 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=XLKX/DDFIRPvx5t6DaUjc92tk+3Aa7daTr762N5Ifkc=; b=pdNB0VcZCEAkdxlrag2cDewU1i+xj68obYmHeCUndATNX0L/s65xueWFegD9ksILHj sL3i/3NMkAXgZUp+JhoO4V6EiN4CQAIPV1IBnEoaaWdfWEu0iKs2VkNl6xvEdbMvAh9C llNbXd/pQObjybM1A2oLArLYYdOVkP4MNiVWAsDINi3QCBYdFz4lViM6e8RefJvDcYpD 0pn/H94AEHVcKzntuwskvhnaLrsX5ITmvu8X1Dec0vbgdpIz+5GC9inio5esOPheRDPP WmScInWas5bDQopLkEmWqCtJ4Kw2MrWBAs0WqI6+TjqOd4Gu0giyd6RQQSM2LU8/nTAT oxQA== X-Forwarded-Encrypted: i=1; AJvYcCUWRf+P0h/fyiXVQXJ61uOy4Lnf7h6QLWKZuBtVPaVUDk8WQNQZymxFQRbmaPQJtXy/tB/ZSVqofsTtFA==@vger.kernel.org X-Gm-Message-State: AOJu0YzINnjrmx+q/zpAoM7DAmo5BrFgCKC0yuoggRXPLT/2NhfyQAHu vkm1hopDKwHO7MhSdLBKfnHEFPJWzJXvZ+2HRODuW0syMaQfgqSecWFMt0mJedM= X-Gm-Gg: ASbGncuH/pyLApWUxBIShSS6rnFtyGzpBoSzikHh8wq+5fD+0j/hTYLTr6S6htGo+xT PEMzC8RxjDKrv/zuW+HQ4FsC6qavVhp45kYWvBrZj75Rhs7Tews/1Ke2YgaTXuBvpFpWrcL/MtY xikqsk7yNryl+UYRk/jHYBTaOa3Wl70Wz1w47R35h23VBzMmNbOSvgnM+waLxOj3peYe/G/fm9f he46fgehkZXzDNOA/tBaFzTw7pWxTEpJKtz3oy8/4pS7cZR6n3YiWsdxweC1HZB1KPh2zs= X-Google-Smtp-Source: AGHT+IFmkhn29wqYEMmrNGScq5CXWT6m6SapSyW0XiDfeMVUzsZXK4EWiuoixIVsOEwexnWV5pkkww== X-Received: by 2002:a17:907:6d1f:b0:aa5:a60:ad6a with SMTP id a640c23a62f3a-aac2d4472c8mr1834711266b.8.1736024083242; Sat, 04 Jan 2025 12:54:43 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aaf4a841749sm839666666b.137.2025.01.04.12.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 12:54:42 -0800 (PST) From: Krzysztof Kozlowski To: Mark Brown , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , David Rhodes , Richard Fitzgerald , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, patches@opensource.cirrus.com Cc: Krzysztof Kozlowski Subject: [PATCH 2/4] spi: atmel-quadspi: Fix printed error code during DMA setup Date: Sat, 4 Jan 2025 21:54:35 +0100 Message-ID: <20250104205437.184782-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250104205437.184782-1-krzysztof.kozlowski@linaro.org> References: <20250104205437.184782-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On dma_request_chan() failure driver NULL-ifies the 'rx_chan' and immediately uses it as PTR_ERR() so dev_err_probe() prints incorrect error code. Rework the code so proper error code will be printed and NULL-ifying of 'rx_chan' will happen in common error handling block (failure of DMA setup is not fatal for the driver and further code depends on 'rx_chan' being non-NULL for DMA operations). Reported by Smatch: drivers/spi/atmel-quadspi.c:1287 atmel_qspi_dma_init() warn: passing zero to 'PTR_ERR' Signed-off-by: Krzysztof Kozlowski --- drivers/spi/atmel-quadspi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index d135cca4e454..057bc20a74ce 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -1283,9 +1283,9 @@ static int atmel_qspi_dma_init(struct spi_controller *ctrl) aq->rx_chan = dma_request_chan(&aq->pdev->dev, "rx"); if (IS_ERR(aq->rx_chan)) { - aq->rx_chan = NULL; - return dev_err_probe(&aq->pdev->dev, PTR_ERR(aq->rx_chan), - "RX DMA channel is not available\n"); + ret = dev_err_probe(&aq->pdev->dev, PTR_ERR(aq->rx_chan), + "RX DMA channel is not available\n"); + goto null_rx_chan; } aq->tx_chan = dma_request_chan(&aq->pdev->dev, "tx"); @@ -1306,8 +1306,9 @@ static int atmel_qspi_dma_init(struct spi_controller *ctrl) release_rx_chan: dma_release_channel(aq->rx_chan); - aq->rx_chan = NULL; aq->tx_chan = NULL; +null_rx_chan: + aq->rx_chan = NULL; return ret; } From patchwork Sat Jan 4 20:54:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13926360 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DB381D63D1 for ; Sat, 4 Jan 2025 20:54:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024090; cv=none; b=rtlQBap14jH55qIdsenuc3bVWU1aElbCh+k4wbsmbOeExInstX9KAuRt8hEOybrSwk5XDzOB1lgE8by4Vv+ISQPklrY3DiDdhUV7jNPvemtt4DNfhH59YuSy/CMI2fO8ZgqX8QWVlEwVunIHoiCro8XRUm3b9vqDA8UtYV+XSSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024090; c=relaxed/simple; bh=OVi515b6fvB1D8FMPWpdYGP+XIs4Du8HE+mgPE8IwMA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QASe1hjH/6C+hBtJHYAcFP7UOdp71wimdOf/XnVVIiSkHEe0DRhAXqC+/EYpxqfOxaZdyQ3NJs7XpriSmAadBsD/lQHa7u05CPLkRXTaBnvdH4+cu+Rl8LwbZUi+nVARQjuFlyPnAuTC093aEcabdi7FqoVi5bIPDRAcn+Li9Fs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=OqBLnas0; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OqBLnas0" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5d3d69e5b63so2180192a12.1 for ; Sat, 04 Jan 2025 12:54:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736024086; x=1736628886; 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=/5tKgeyFg00MgtfGaAYBuFBjwqBNpORNVJY5iBPqbW0=; b=OqBLnas0b3u2iphRWe03NbjI9mEC+QoYFvHc7vHsBTCAdTqXB09dyuMPCIS8LbA0/j 0MOEz5wCDpMW+v6WZ6XLrrgzkUkC1BKicdJIChrjeDRv2Em+iEtSAzfyIG+BbTBDE6hk fzfEvzyelEUH3Z2Ypa9v3zbQYTFBe+ZBJCPuhldNbksJdpFqrZRChtgu1m61RVC+sJ2Y 1DOxw9V9xxpKchaynbwuBVdJUlnED9WJtewEzwis3lo5GlIhWO1cCflU51ecb8ng70Bk iod3rOndeUw1e/Kx2WffdCIsK+fZstD5VIkhepAokhf1B3nBDBBlt1JWgOc29uEPvykc JTtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736024086; x=1736628886; 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=/5tKgeyFg00MgtfGaAYBuFBjwqBNpORNVJY5iBPqbW0=; b=oTrFlNoYWxO19tjlzgSwDcBRJFV/XzU9eb1Vv3KppF8qPoCTQ9xlTUJBy4077Gb92+ LspubeZRfyinrwuXBgz9gr39w4nQZfBRAoVdVqfrHWzzKZ3bZ/hnvnz5dN/XrjHlPY4L 9NH/+fx3pdR8JvnjbXZ36DSyhlwhVv7g/YXy8+hJjwC+4qEqvymGmxgm9GvwN8+3SEMa BmP7A0AEIWhmP2kIYA8ErAGVS8tyn6WdJ1VG2FnKxsRDSGdySTX8mH2mcsAtlaZMsNa3 2DjRY8RLVFRgC5EhyrFakCgs+CRrlEPOhLvhQZdO8Fp6hH6xV3mMuP0/pCNUc594LPYc t7ew== X-Forwarded-Encrypted: i=1; AJvYcCUv5HySMe7NE/4MzGz6N2DBn27ypXk2BWupXLjjfVqo26pgisAqKouhXkeFXXRVtAtT9PtPzM7CQMVfRg==@vger.kernel.org X-Gm-Message-State: AOJu0YxlZ7YQ2mo/rhQid9B5vqBOKO9lByNQ17CnSh57WajsKgyrQXXV 3HrfPW4Aw8OJUQhOIvuAE9MjJLTJCtGr2TUYWLccYKglP9DyrkTQcumqiazWkGo= X-Gm-Gg: ASbGncs2ei7RH6bXP9zjrkHNR5f/vuTcJWOG0yfWdpDuB8qBnn4yM40PGa3DzN+Yt6e HWy/LYbazYsjiUK1M+brn93yhE8iykH8bGdPqVhvXLjLbCVlqJjklAbC3RBfKfKxTa2IbtWr3GM lOzUzdexeXi/iHMYKp8qatHGzbyAAw5x6aHaSY7FT3XJhfNuGWlzsBR2gjKkHo6wHbsEnac4oHc NqwlxEyJLOxwtvmuEPVwOdMS5xmQc8XLwIpLgl8LRIMwktI4yY7Oeshn64wc+OCqeIBH7Q= X-Google-Smtp-Source: AGHT+IFYBTBJPclwUSGwCj06Or/uq4VGv6lfISakgOmL+cPEXrHfIpLkbx2RfKlkxwiJ7dN0dGBBQQ== X-Received: by 2002:a05:6402:2349:b0:5d0:214b:96b4 with SMTP id 4fb4d7f45d1cf-5d81dd5a17dmr16470255a12.1.1736024086537; Sat, 04 Jan 2025 12:54:46 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aaf4a841749sm839666666b.137.2025.01.04.12.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 12:54:45 -0800 (PST) From: Krzysztof Kozlowski To: Mark Brown , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , David Rhodes , Richard Fitzgerald , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, patches@opensource.cirrus.com Cc: Krzysztof Kozlowski Subject: [PATCH 3/4] spi: cs42l43: Make handling missing spk-id GPIOs explicit Date: Sat, 4 Jan 2025 21:54:36 +0100 Message-ID: <20250104205437.184782-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250104205437.184782-1-krzysztof.kozlowski@linaro.org> References: <20250104205437.184782-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 gpiod_get_array_optional() for spk-id GPIOs can return NULL, if they are missing, so do not pass the value to PTR_ERR but instead explicitly treat NULL as acceptable condition. The old code was correct, but misleading because PTR_ERR usually is used on errors. Reported by Smatch: drivers/spi/spi-cs42l43.c:241 cs42l43_get_speaker_id_gpios() warn: passing zero to 'PTR_ERR' Signed-off-by: Krzysztof Kozlowski --- drivers/spi/spi-cs42l43.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-cs42l43.c b/drivers/spi/spi-cs42l43.c index ceefc253c549..90180662c4c2 100644 --- a/drivers/spi/spi-cs42l43.c +++ b/drivers/spi/spi-cs42l43.c @@ -237,7 +237,9 @@ static int cs42l43_get_speaker_id_gpios(struct cs42l43_spi *priv, int *result) int i, ret; descs = gpiod_get_array_optional(priv->dev, "spk-id", GPIOD_IN); - if (IS_ERR_OR_NULL(descs)) + if (!descs) + return 0; + else if (IS_ERR_OR_NULL(descs)) return PTR_ERR(descs); spkid = 0; From patchwork Sat Jan 4 20:54:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13926361 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 817D01D7989 for ; Sat, 4 Jan 2025 20:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024093; cv=none; b=sqioc/gZp/IoIbEHZHtxt4822TMIyRk+RiIZCVpWxtbfnfZrC92GMlizkWLM+8fewFYbi4Wz3iYUoEXsG7ge6P1wO4tHQdO3NDIbNxxTccKsXlDLjYiVZEWYcpremhW8wx6gVas/FN+CzJ7/QnKyARj4xFMyoHKtq2Ylv7Lvmik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736024093; c=relaxed/simple; bh=KoYJDmouknRxlX7izHTU83doe8p6XKitvlO210BlS5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=axE9ARlAFW/Pryd5HSezmmpmaYwMmMf83dXdJOWAGDSRGWhVsxHOHbThTVMwIsOIPDvfHLUDNDFzXtX2TYp4NR4PKS+LKxgPBTbmrGyyPSgTHbQSKw3Bl02wTcUQxctEgKmkFaJfRbO6gBDkZN+Y8UdxhE+zUsE1/2Zn5DQ4TXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nlij1iJL; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nlij1iJL" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-aa69599b4b0so204395566b.3 for ; Sat, 04 Jan 2025 12:54:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736024089; x=1736628889; 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=CmawReunhMQT1RzOmjM1xjN/S/KwjF4WQ4NuUA53NuA=; b=nlij1iJLZaSM+evO8c9zKTPpkE29lVavo8rdtfErtlz2i2eb3nFUKCRrluIU4URSFd dfVgSw7EMKaYBn1/w/q5SFyFegzaXg5AEc1H6TKF2agMO8qBhcIstLqxdc6/A8rq3CB0 deeGfsOZ/afk5fD2Lmz61OsUuh23r+OJq17Avtgr1RzGexcZkMXA79S6sli+f0Ua+qpa qVe6A4PxA/E/HidmMEsYbu5POlN6ZlmNnCOLYvYUfUXIjasNDybFSM5T4PlPKqxjivO1 0USawm2N2up/vxDLd3Qa/e4bh74fsyY35q6VixHAaJ4CuLml12cPiGojEOuNyZtCxdet nAkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736024089; x=1736628889; 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=CmawReunhMQT1RzOmjM1xjN/S/KwjF4WQ4NuUA53NuA=; b=cb/ZpeEa6tAB8vSiGnZd8fdztYPznMeGUsL5ojaUU/fPmZ+etbcdR16xPU4FTGnlPe xBrFlo0X9m4s31RKWUEGF2AoofTB/0g4TdxLAGVW3cwhacUDw0fO6FmLkVWH32hx5SlG ooGBZy2oZgJvtTU8TWCsT8+d99GfZ7i67cVH53u8VvAmPmfrhF0udTtgKbZeCgw92p8T r1nEOdbs5XVGPw0/lXZZfyNfMW2g4ztWba8IULsYxtl0j9i8vMayqWVhhWFK8s4FEf5l 494ER/PAIOPTTvke+8sepZ+X1TUXyLIiXWbGIxbUjIDUYaWnbnYdw/63JINRb/e9N1yx snBQ== X-Forwarded-Encrypted: i=1; AJvYcCVfBFiDLEKHF4BifeWiLKRjwaAovnTd5TxhrrnIVcv6q8PpkMgZ1I6+mdhdTcsj5gQvwGRntELdexjpLQ==@vger.kernel.org X-Gm-Message-State: AOJu0YwvdJpi/ehK8GvdaomS0smB7Ayt6V5gEnWS3B4oY0+4rxT+M1lS D9GimVcDXDuDm0yCGgCMyzulKNySa7zcyRsTUgRMUIjlmjsGN04CbmAqVDtKsXI= X-Gm-Gg: ASbGncts9zRsRTgzgy9rFezwAFCcDhxH3wilhW00/rQFzCPkW2S1DxFyueh5UHxuvRo BLTP9Qtbfr3QKyF7MELelxx2/lEnXdC+XyzeKI2c0cTt3CG9rmb73qv468bch645oMSzmgQ17uJ csfwCyXrPxOFU6K0K0RW53jK7CofchiJ7CnHnJVRWiSOeb6xCta88DPHfduFtsJyHMq6ORAA0ef XzkFXlqd9JnJoXhnub4U5kA1fo3Att7UQWM4fPN8ooeXEfjQv5pTXKuL+tGUyK+BCoz51g= X-Google-Smtp-Source: AGHT+IG0xF9hR17ga58c9EDJR/+6VF92Xk90OmLLRzHetd12T6z8pp2lmmUMDY7ynIlHUG5keK+6nQ== X-Received: by 2002:a17:907:d9e:b0:aa6:aaa8:b4a4 with SMTP id a640c23a62f3a-aac2d431db3mr1515258466b.8.1736024088851; Sat, 04 Jan 2025 12:54:48 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aaf4a841749sm839666666b.137.2025.01.04.12.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 12:54:47 -0800 (PST) From: Krzysztof Kozlowski To: Mark Brown , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , David Rhodes , Richard Fitzgerald , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, patches@opensource.cirrus.com Cc: Krzysztof Kozlowski Subject: [PATCH 4/4] spi: cadence-quadspi: Assume device could match via platform Date: Sat, 4 Jan 2025 21:54:37 +0100 Message-ID: <20250104205437.184782-4-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250104205437.184782-1-krzysztof.kozlowski@linaro.org> References: <20250104205437.184782-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Driver has only of_device_id table, however it also has MODULE_ALIAS() for platform name, thus assume there is a configuration where this can be loaded outside of OF system. In such case of_device_get_match_data() will return NULL, which is already checked in one place of probe() function but not in the other, leading to Smatch warning: drivers/spi/spi-cadence-quadspi.c:1942 cqspi_probe() error: we previously assumed 'ddata' could be null (see line 1885) Driver should be consistent, so assume device can be matched via platform bus and of_device_get_match_data() can indeed return NULL. This is also possible with malformed DTS on OF-platform: no unit address and device node name matching driver name. Signed-off-by: Krzysztof Kozlowski --- drivers/spi/spi-cadence-quadspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 47477f2d9a25..e9197bf9d739 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1939,7 +1939,7 @@ static int cqspi_probe(struct platform_device *pdev) host->num_chipselect = cqspi->num_chipselect; - if (ddata->quirks & CQSPI_SUPPORT_DEVICE_RESET) + if (ddata && (ddata->quirks & CQSPI_SUPPORT_DEVICE_RESET)) cqspi_device_reset(cqspi); if (cqspi->use_direct_mode) {