This allows the removal of the struct rpi_firmware* member from struct vchiq_drvdata. Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@xxxxxxxxxx> --- .../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@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel