diff options
author | Arnd Bergmann <arnd@arndb.de> | 2024-09-02 10:23:22 +0000 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2024-09-02 10:23:22 +0000 |
commit | ec62e2e82581237417cd3f4a2f1ece6483d36c85 (patch) | |
tree | db41ec493f948d7d5d319494fe5941b1f8fe6616 /drivers/firmware | |
parent | e99769bf7adfdbaab98b5f79f2ae7cedbca2103b (diff) | |
parent | 8812b8689ee652ee7f7e958473a9de56d7c184b6 (diff) |
Merge tag 'tegra-for-6.12-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
firmware: tegra: Changes for v6.12-rc1
The changes in this set remove some unused code and simplify error paths
using scoped helpers.
* tag 'tegra-for-6.12-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
firmware: tegra: bpmp: Use scoped device node handling to simplify error paths
firmware: tegra: bpmp: Drop unused mbox_client_to_bpmp()
Link: https://lore.kernel.org/r/20240830141004.3195210-2-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/tegra/bpmp.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index c1590d3aa9cb..2bee6e918f81 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 <linux/cleanup.h> #include <linux/clk/tegra.h> #include <linux/genalloc.h> #include <linux/mailbox_client.h> @@ -24,12 +25,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) { @@ -40,29 +35,24 @@ channel_to_ops(struct tegra_bpmp_channel *channel) struct tegra_bpmp *tegra_bpmp_get(struct device *dev) { + struct device_node *np __free(device_node); struct platform_device *pdev; struct tegra_bpmp *bpmp; - struct device_node *np; np = 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); |