media: ipu3-cio2: Introduce to_cio2_device() helper macro
Provide to_cio2_device() helper macro and convert users to make code easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
8b0a8b1b61
commit
96d309a933
|
@ -1376,8 +1376,7 @@ static int cio2_notifier_bound(struct v4l2_async_notifier *notifier,
|
||||||
struct v4l2_subdev *sd,
|
struct v4l2_subdev *sd,
|
||||||
struct v4l2_async_subdev *asd)
|
struct v4l2_async_subdev *asd)
|
||||||
{
|
{
|
||||||
struct cio2_device *cio2 = container_of(notifier,
|
struct cio2_device *cio2 = to_cio2_device(notifier);
|
||||||
struct cio2_device, notifier);
|
|
||||||
struct sensor_async_subdev *s_asd = to_sensor_asd(asd);
|
struct sensor_async_subdev *s_asd = to_sensor_asd(asd);
|
||||||
struct cio2_queue *q;
|
struct cio2_queue *q;
|
||||||
|
|
||||||
|
@ -1398,8 +1397,7 @@ static void cio2_notifier_unbind(struct v4l2_async_notifier *notifier,
|
||||||
struct v4l2_subdev *sd,
|
struct v4l2_subdev *sd,
|
||||||
struct v4l2_async_subdev *asd)
|
struct v4l2_async_subdev *asd)
|
||||||
{
|
{
|
||||||
struct cio2_device *cio2 = container_of(notifier,
|
struct cio2_device *cio2 = to_cio2_device(notifier);
|
||||||
struct cio2_device, notifier);
|
|
||||||
struct sensor_async_subdev *s_asd = to_sensor_asd(asd);
|
struct sensor_async_subdev *s_asd = to_sensor_asd(asd);
|
||||||
|
|
||||||
cio2->queue[s_asd->csi2.port].sensor = NULL;
|
cio2->queue[s_asd->csi2.port].sensor = NULL;
|
||||||
|
@ -1408,8 +1406,7 @@ static void cio2_notifier_unbind(struct v4l2_async_notifier *notifier,
|
||||||
/* .complete() is called after all subdevices have been located */
|
/* .complete() is called after all subdevices have been located */
|
||||||
static int cio2_notifier_complete(struct v4l2_async_notifier *notifier)
|
static int cio2_notifier_complete(struct v4l2_async_notifier *notifier)
|
||||||
{
|
{
|
||||||
struct cio2_device *cio2 = container_of(notifier, struct cio2_device,
|
struct cio2_device *cio2 = to_cio2_device(notifier);
|
||||||
notifier);
|
|
||||||
struct device *dev = &cio2->pci_dev->dev;
|
struct device *dev = &cio2->pci_dev->dev;
|
||||||
struct sensor_async_subdev *s_asd;
|
struct sensor_async_subdev *s_asd;
|
||||||
struct v4l2_async_subdev *asd;
|
struct v4l2_async_subdev *asd;
|
||||||
|
|
|
@ -401,6 +401,8 @@ struct cio2_device {
|
||||||
dma_addr_t dummy_lop_bus_addr;
|
dma_addr_t dummy_lop_bus_addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define to_cio2_device(n) container_of(n, struct cio2_device, notifier)
|
||||||
|
|
||||||
/**************** Virtual channel ****************/
|
/**************** Virtual channel ****************/
|
||||||
/*
|
/*
|
||||||
* This should come from sensor driver. No
|
* This should come from sensor driver. No
|
||||||
|
|
Loading…
Reference in New Issue