1 From 9243f7de67345adfcac52198f78bd12cfebb6867 Mon Sep 17 00:00:00 2001
2 From: Kieran Bingham <kieran.bingham@ideasonboard.com>
3 Date: Wed, 20 Mar 2019 11:35:26 +0000
4 Subject: [PATCH] staging: bcm2835-codec: Pass driver context to create
7 Pass the bcm2835_codec_driver driver context directly into the
8 bcm2835_codec_create() so that it can be used to store driver global
9 state. Pass the struct platform_device *pdev by adding it to the driver
12 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
14 .../bcm2835-codec/bcm2835-v4l2-codec.c | 13 +++++++++----
15 1 file changed, 9 insertions(+), 4 deletions(-)
17 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
19 @@ -457,6 +457,8 @@ struct bcm2835_codec_ctx {
22 struct bcm2835_codec_driver {
23 + struct platform_device *pdev;
25 struct bcm2835_codec_dev *encode;
26 struct bcm2835_codec_dev *decode;
27 struct bcm2835_codec_dev *isp;
28 @@ -2587,10 +2589,11 @@ destroy_component:
32 -static int bcm2835_codec_create(struct platform_device *pdev,
33 +static int bcm2835_codec_create(struct bcm2835_codec_driver *drv,
34 struct bcm2835_codec_dev **new_dev,
35 enum bcm2835_codec_role role)
37 + struct platform_device *pdev = drv->pdev;
38 struct bcm2835_codec_dev *dev;
39 struct video_device *vfd;
41 @@ -2711,15 +2714,17 @@ static int bcm2835_codec_probe(struct pl
45 - ret = bcm2835_codec_create(pdev, &drv->decode, DECODE);
48 + ret = bcm2835_codec_create(drv, &drv->decode, DECODE);
52 - ret = bcm2835_codec_create(pdev, &drv->encode, ENCODE);
53 + ret = bcm2835_codec_create(drv, &drv->encode, ENCODE);
57 - ret = bcm2835_codec_create(pdev, &drv->isp, ISP);
58 + ret = bcm2835_codec_create(drv, &drv->isp, ISP);