From: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
To: gregkh@linuxfoundation.org, eric@anholt.net, wahrenst@gmx.net
Cc: devel@driverdev.osuosl.org, linux-rpi-kernel@lists.infradead.org
Subject: [PATCH 1/2] staging: vchiq: Move retrieval of rpi_firmware to vchiq_platform_init()
Date: Mon, 11 Nov 2019 12:14:23 -0500 [thread overview]
Message-ID: <6054322775b30a90c1fed28a085e5fd578ed70fa.1573482698.git.marcgonzalez@google.com> (raw)
In-Reply-To: <cover.1573482698.git.marcgonzalez@google.com>
This allows the removal of the struct rpi_firmware* member
from struct vchiq_drvdata.
Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
---
.../interface/vchiq_arm/vchiq_2835_arm.c | 14 +++++++++++++-
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 14 --------------
.../vc04_services/interface/vchiq_arm/vchiq_arm.h | 1 -
3 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 8dc730cfe7a6..5ac88be9496b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -79,7 +79,8 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
{
struct device *dev = &pdev->dev;
struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
- struct rpi_firmware *fw = drvdata->fw;
+ struct device_node *fw_node;
+ struct rpi_firmware *fw;
struct vchiq_slot_zero *vchiq_slot_zero;
struct resource *res;
void *slot_mem;
@@ -88,6 +89,17 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
int slot_mem_size, frag_mem_size;
int err, irq, i;
+ fw_node = of_find_compatible_node(NULL, NULL,
+ "raspberrypi,bcm2835-firmware");
+ if (!fw_node) {
+ dev_err(&pdev->dev, "Missing firmware node\n");
+ return -ENOENT;
+ }
+ fw = rpi_firmware_get(fw_node);
+ of_node_put(fw_node);
+ if (!fw)
+ return -EPROBE_DEFER;
+
/*
* VCHI messages between the CPU and firmware use
* 32-bit bus addresses.
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index b1595b13dea8..c666c8b5eda2 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -3191,7 +3191,6 @@ vchiq_register_child(struct platform_device *pdev, const char *name)
static int vchiq_probe(struct platform_device *pdev)
{
- struct device_node *fw_node;
const struct of_device_id *of_id;
struct vchiq_drvdata *drvdata;
struct device *vchiq_dev;
@@ -3201,19 +3200,6 @@ static int vchiq_probe(struct platform_device *pdev)
drvdata = (struct vchiq_drvdata *)of_id->data;
if (!drvdata)
return -EINVAL;
-
- fw_node = of_find_compatible_node(NULL, NULL,
- "raspberrypi,bcm2835-firmware");
- if (!fw_node) {
- dev_err(&pdev->dev, "Missing firmware node\n");
- return -ENOENT;
- }
-
- drvdata->fw = rpi_firmware_get(fw_node);
- of_node_put(fw_node);
- if (!drvdata->fw)
- return -EPROBE_DEFER;
-
platform_set_drvdata(pdev, drvdata);
err = vchiq_platform_init(pdev, &g_state);
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
index b424323e9613..e2cdfddaf02a 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
@@ -97,7 +97,6 @@ struct vchiq_arm_state {
struct vchiq_drvdata {
const unsigned int cache_line_size;
- struct rpi_firmware *fw;
};
extern int vchiq_arm_log_level;
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2019-11-11 17:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 17:14 [PATCH 0/2] Remove global struct vchiq_drvdata variables Marcelo Diop-Gonzalez
2019-11-11 17:14 ` Marcelo Diop-Gonzalez [this message]
2019-11-12 23:09 ` [PATCH 1/2] staging: vchiq: Move retrieval of rpi_firmware to vchiq_platform_init() Greg KH
2019-11-12 23:29 ` Marcelo Diop-Gonzalez
2019-11-13 5:32 ` Greg KH
2019-11-13 14:08 ` Marcelo Diop-Gonzalez
2019-11-13 20:29 ` Marcelo Diop-Gonzalez
2019-11-13 18:17 ` Dan Carpenter
2019-11-13 19:58 ` Marcelo Diop-Gonzalez
2019-11-11 17:14 ` [PATCH 2/2] staging: vchiq: Remove global bcm*_drvdata Marcelo Diop-Gonzalez
2019-11-13 18:18 ` Dan Carpenter
2019-11-13 18:40 ` Stefan Wahren
2019-11-13 19:56 ` Marcelo Diop-Gonzalez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6054322775b30a90c1fed28a085e5fd578ed70fa.1573482698.git.marcgonzalez@google.com \
--to=marcgonzalez@google.com \
--cc=devel@driverdev.osuosl.org \
--cc=eric@anholt.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).