[PATCH 2/2] staging: vchiq: Remove global bcm*_drvdata

Marcelo Diop-Gonzalez marcgonzalez at google.com
Wed Nov 13 19:56:56 UTC 2019


On Wed, Nov 13, 2019 at 1:40 PM Stefan Wahren <wahrenst at gmx.net> wrote:
>
> Hello Marcelo,
>
> Am 11.11.19 um 18:14 schrieb Marcelo Diop-Gonzalez:
> > Moving the DT node check to vchiq_platform_init()
> > removes the need for these.
>
> this comment does match to your changes. Also i'm missing a why this is
> necessary.
>
> >
> > Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez at google.com>
> > ---
> >  .../interface/vchiq_arm/vchiq_2835_arm.c      |  4 ++--
> >  .../interface/vchiq_arm/vchiq_arm.c           | 20 ++-----------------
> >  .../interface/vchiq_arm/vchiq_arm.h           |  4 ----
> >  3 files changed, 4 insertions(+), 24 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 5ac88be9496b..b133b25c44af 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
> > @@ -78,7 +78,6 @@ free_pagelist(struct vchiq_pagelist_info *pagelistinfo,
> >  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 device_node *fw_node;
> >       struct rpi_firmware *fw;
> >       struct vchiq_slot_zero *vchiq_slot_zero;
> > @@ -109,7 +108,8 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
> >       if (err < 0)
> >               return err;
> >
> > -     g_cache_line_size = drvdata->cache_line_size;
> > +     if (of_device_is_compatible(dev->of_node, "brcm,bcm2836-vchiq"))
> > +             g_cache_line_size = 64;
> >       g_fragments_size = 2 * g_cache_line_size;
> >
> >       /* Allocate space for the channels in coherent memory */
> > 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 c666c8b5eda2..cc753ba9c68c 100644
> > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> > @@ -140,14 +140,6 @@ static DEFINE_SPINLOCK(msg_queue_spinlock);
> >  static struct platform_device *bcm2835_camera;
> >  static struct platform_device *bcm2835_audio;
> >
> > -static struct vchiq_drvdata bcm2835_drvdata = {
> > -     .cache_line_size = 32,
> > -};
> > -
> > -static struct vchiq_drvdata bcm2836_drvdata = {
> > -     .cache_line_size = 64,
> > -};
> You are touching new code which was introduced to keep the driver easier
> to maintain (e.g. add support for new SoCs like BCM2711 on Raspberry Pi 4).
>
> So please keep the OF match data handling. But i'm happy to see the
> platform data as a const.
>

Oh ok I see, didn't realize that was the reason for it. I think we
should just scrap this patchset in that case.

Thanks,

-Marcelo


More information about the devel mailing list