From patchwork Fri Aug 16 13:57:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1973264 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=PUNgIjoU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=linux-tegra+bounces-3318-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wlk8K6QKZz20GC for ; Fri, 16 Aug 2024 23:57:37 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 041541F25434 for ; Fri, 16 Aug 2024 13:57:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84DA61BC9E5; Fri, 16 Aug 2024 13:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PUNgIjoU" X-Original-To: linux-tegra@vger.kernel.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 38CEB1AC8B8 for ; Fri, 16 Aug 2024 13:57:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723816653; cv=none; b=VZoABzDTDkBUPamGcgsgFdSsVrzHlz4x++Dffux7/mzacgv20PWzTBSs5q3WtY2o7IUWUPWxwhnMdxKz2blDMvb7d6nJ7Z1tb4ELuFK51+YJVeflIMXvsCSJrXxY/9ScG/eMD6TtHWeVnNPnlSrIKPJ8nR5nKeiUflMgf1S9wgA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723816653; c=relaxed/simple; bh=bhKl8LrqSNNy1pCMzfb2la/HnUfCqWNtqkdVM7XHdW4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Fx5nuvWX8WWBEUbHsk7fXV98h3uqetR5bXaI0o8WsacDtynyAdEczrMwm70lToiU7sjVvBBecL27/ZeEgaqIY+/NWz5c6TiaHwV4lYSMIp1OQy3zjNmg0eHjcAsL2pzQRbH0HXJHY0t2+1+9lwlgul97rL5N6YnERIRRKkEJ4Zc= 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=PUNgIjoU; arc=none smtp.client-ip=209.85.128.45 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 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-429d2d7be1eso10555435e9.1 for ; Fri, 16 Aug 2024 06:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723816648; x=1724421448; 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=TUFNUXrgokXIwMs6WyuldKV0ZX1UE+1k07OmPjO8LYM=; b=PUNgIjoUp4E6BcHv/9txKXtLNQH6UnoJ8vYc79mK6ktExzy4vFH0DVKEKUMbiBHqFT Lud8vllDmLRYVeelE3zoOl14JcUqK6aF5L/5HbtKMtZOGbMBfFBGvM2YeULzkA3Y5kMK eVOUIDsDgV0Xd4iXAriM8pRNB4D18/O2UZ+o0yXjbQ3F3U2zDoLCJ10jnWWTteLbOeBg RLuxURTBUXfDK/fWvETtdSNkyMcyHeZ1F0tTdxgsvmAjObYmr7CKUWsma3pqdvDTneiN 2vVqypBE+XGAPHsNTxpet4VjPOH9guXxDxCaQVFlvv34/Tb/T56jCG5nccj7rfGHw29N Q7nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723816648; x=1724421448; 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=TUFNUXrgokXIwMs6WyuldKV0ZX1UE+1k07OmPjO8LYM=; b=qZl1vKJczvVX+/o9ReH3dheKVqygMing25zHozQbt0fwfmzWWmofb0RxSOnCOXe/SJ WKS8/F5moAtavOtNgjMw3jq4ZxtdNdGP1HxtHWtNkfOw/5PyZMx66Nk65LQj//gF40L+ zVeOSwZFvGyp4GYOGoyNelO6jJyS3fyxf8JpvOFwK7BHq07kLZNNFkfD2YuAH4XEb9A7 8OuEZgnoUvGsbI71L4MXtCpj5OV4zci59oEKMAu5Qa0HqsUd4g69wAgLDTj0MdfHBD7o PGspbJmr/xyQ21FSg2wPYbb2wakNFc52HjqthySaiP2VAfHoEX8JrApAEUDcEu8uTfqe HgGQ== X-Forwarded-Encrypted: i=1; AJvYcCUuMfzwjtjNKM7C+RLBV3yrMdZio6RvZBD9a2J/rP1/3qn0vHh7ZCRbA1rXUKYa9bR3nte0R1uw1gv0JOUs+fMURrVXKNGjVv088Qc= X-Gm-Message-State: AOJu0YzgIuvW2mV3HyzQ8ZUIkXwixc35H7dRfHYT5reTYX/Ifb+zMKh4 1E41aW3oKtvf9dyP/YnHEFmRvn5gW+kD2zMNPZ+FfoXieXfmKjXhDn90RTBunEI= X-Google-Smtp-Source: AGHT+IFd4s3kymirxsu7ePVn8TcQO9UzOm0dQNnvzYRLs823Sud4ew3QO74mnMOX7OeGvHmgZRcr8Q== X-Received: by 2002:a05:600c:450c:b0:424:8743:86b4 with SMTP id 5b1f17b1804b1-429e232b8a0mr48393265e9.6.1723816648319; Fri, 16 Aug 2024 06:57:28 -0700 (PDT) Received: from krzk-bin.. ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded36a95sm76183995e9.28.2024.08.16.06.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 06:57:27 -0700 (PDT) From: Krzysztof Kozlowski To: Thierry Reding , Jonathan Hunter , Timo Alho , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH 1/2] firmware: tegra: bpmp: drop unused mbox_client_to_bpmp() Date: Fri, 16 Aug 2024 15:57:21 +0200 Message-ID: <20240816135722.105945-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-tegra@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 mbox_client_to_bpmp() is not used, W=1 builds: drivers/firmware/tegra/bpmp.c:28:1: error: unused function 'mbox_client_to_bpmp' [-Werror,-Wunused-function] Fixes: cdfa358b248e ("firmware: tegra: Refactor BPMP driver") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/firmware/tegra/bpmp.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index c1590d3aa9cb..c3a1dc344961 100644 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@ -24,12 +24,6 @@ #define MSG_RING BIT(1) #define TAG_SZ 32 -static inline struct tegra_bpmp * -mbox_client_to_bpmp(struct mbox_client *client) -{ - return container_of(client, struct tegra_bpmp, mbox.client); -} - static inline const struct tegra_bpmp_ops * channel_to_ops(struct tegra_bpmp_channel *channel) { From patchwork Fri Aug 16 13:57:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1973265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=skoonXmm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=linux-tegra+bounces-3319-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wlk8K5Prhz1yfB for ; Fri, 16 Aug 2024 23:57:37 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5FC7C1F2414E for ; Fri, 16 Aug 2024 13:57:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5E0E1BCA1C; Fri, 16 Aug 2024 13:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="skoonXmm" X-Original-To: linux-tegra@vger.kernel.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 BBCC61BB684 for ; Fri, 16 Aug 2024 13:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723816653; cv=none; b=YO7jLcIAnmQQdMOYGs5hyyp+TzVYTKU9Mx/5WIGj+d7oE9hvYvh+A+fL3509sK5mPm0kTJ0Eat42lSxfESYbkEd6u/4XSnmlAPmVy7xSgcjoiTuxY8mSjNsgsLWCWMGQayg6MK++5wUYYvISa1ELKjzdhf20//kyxaSNc6RJz7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723816653; c=relaxed/simple; bh=ES5WNhjQ97KkXEVEYI5UMpRbkvt68q9g+APgmhu1B+o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bmnJn2wxNzti7j0feCzTAdyHKeBUU33ZLxcU4KDBaeOO2Eq03LGXO5wnkdjuuSDcf6NJlL4UKKnLgHFjg8eIjiyU/hTTaHkAzRrVuTozr7zBYiepsalusVI7RtTq3gL2IjdmCt4dF/Wuoh1pzjrbIzM3txeJ8eeSgeK14s8nLwg= 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=skoonXmm; arc=none smtp.client-ip=209.85.128.42 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 Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-429da8b5feaso20493565e9.2 for ; Fri, 16 Aug 2024 06:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723816650; x=1724421450; 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=7FU7Yn36ou/qawMkS1iMJfnBA3me627G17eoAbOIhIU=; b=skoonXmm9AwCuIWHcBSRq8UxYQLVxV/Z0RKihKZpXrIthrUc7QxE3d71BfCLk/V6aO xv3yKRKRwbfy88GCBLQtPbZlcvpR8/p8fu1G05/rBH6JAK2JYvPEk1cv28zNmw73olhU r7zv3kqaOmSVV9s+VHOt7Cg3Hh1HZKKYtz21V5IEH1AE0FjoU6SSgKRtq+w2IC5dufBl aLf/vErAMkaHEErKeivvLPMSCxHjddRq8+XQmsfqzBgxYmDTs2mAcu9pqmZwC+YbJprg putZa7ibi7AfEIuz1U8sTw9JtGDeNcEcOBP49IXR2Z4VBOUtMY5LstBTGh1nBQxC8QIU ah3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723816650; x=1724421450; 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=7FU7Yn36ou/qawMkS1iMJfnBA3me627G17eoAbOIhIU=; b=n0T5ccX8aOU3Bk5e+CwW5Nk44vsQhIB5sk90WgqRkjWkrimwzCUxQ92E/VpdrEa6v8 D3r8B+WSzZ9rirMiAGcvANIe0z7SWtCLs5OrJjJpVSX3E71jk7U0wXdsAS7RsQSuP105 pmaw8NVVtNM16Zcj9mp7JIrQ/jc2DgikMU3VkcyW6nwO4jdA3KmB1b2U6xtGdQ+e4uEg MkGlML2pQHDiRpCjLrJRghghazCU6vsLhMkm0GB6yBJA1VTM+DNVCP8ke+t20nB6h2Np kcfYMeTWutMUl2M71DwA90o7y44PoeraN2ySzjZnaGfqGK9bO+YPfRq9ZJIxsmRWJDwA 9FrQ== X-Forwarded-Encrypted: i=1; AJvYcCXuTbNZyoBoKwvD9Pq/USj15Pw7aFT5pmZmRsa5BqVDmEFTt6mw0XGIoi3Z3sVcLdoYRH8szsvVSLCQRLTKbSntBa4vjjNVocWaIns= X-Gm-Message-State: AOJu0YxBo5wcOpBeZhbgRQuXUuMigYEJ93uwuPdEeL8StI1ceD3qaFcm lNXcHxUF+jscHMGD9jNK2VvIDOgYbras3xc9FxTW96Wav54NnFCjgzWbWOZHwEs= X-Google-Smtp-Source: AGHT+IF64oucyuEIrdECCSfRCeOVjjInXceFWeMY/QFE6S9rq989ayLrMtsEH0Yly5SMl9RtJuP63A== X-Received: by 2002:a05:600c:3b26:b0:426:6f87:65fc with SMTP id 5b1f17b1804b1-429ed7b6a3dmr24128425e9.17.1723816649988; Fri, 16 Aug 2024 06:57:29 -0700 (PDT) Received: from krzk-bin.. ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded36a95sm76183995e9.28.2024.08.16.06.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 06:57:29 -0700 (PDT) From: Krzysztof Kozlowski To: Thierry Reding , Jonathan Hunter , Timo Alho , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/2] firmware: tegra: bpmp: use scoped device node handling to simplify error paths Date: Fri, 16 Aug 2024 15:57:22 +0200 Message-ID: <20240816135722.105945-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240816135722.105945-1-krzysztof.kozlowski@linaro.org> References: <20240816135722.105945-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-tegra@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Obtain the device node reference with scoped/cleanup.h to reduce error handling and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/firmware/tegra/bpmp.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index c3a1dc344961..2edc3838538e 100644 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@ -3,6 +3,7 @@ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. */ +#include #include #include #include @@ -36,27 +37,22 @@ struct tegra_bpmp *tegra_bpmp_get(struct device *dev) { struct platform_device *pdev; struct tegra_bpmp *bpmp; - struct device_node *np; - np = of_parse_phandle(dev->of_node, "nvidia,bpmp", 0); + struct device_node *np __free(device_node) = of_parse_phandle(dev->of_node, + "nvidia,bpmp", 0); if (!np) return ERR_PTR(-ENOENT); pdev = of_find_device_by_node(np); - if (!pdev) { - bpmp = ERR_PTR(-ENODEV); - goto put; - } + if (!pdev) + return ERR_PTR(-ENODEV); bpmp = platform_get_drvdata(pdev); if (!bpmp) { - bpmp = ERR_PTR(-EPROBE_DEFER); put_device(&pdev->dev); - goto put; + return ERR_PTR(-EPROBE_DEFER); } -put: - of_node_put(np); return bpmp; } EXPORT_SYMBOL_GPL(tegra_bpmp_get);