Message ID | 20230525091615.2324824-4-sakari.ailus@linux.intel.com |
---|---|
State | Superseded |
Headers | show |
Series | Separate links and async sub-devices | expand |
Tomi, could you please test this patch ? On Thu, May 25, 2023 at 12:15:46PM +0300, Sakari Ailus wrote: > The async notifier bound callback does a lot of checks that have probably > been always unnecessary. Remove the lookup of the async subev that we > already have, as well as the debug print that is already printed by the > framework. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > drivers/media/platform/xilinx/xilinx-vipp.c | 32 ++++----------------- > 1 file changed, 5 insertions(+), 27 deletions(-) > > diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c > index 3123216b3f70e..b309af0c83749 100644 > --- a/drivers/media/platform/xilinx/xilinx-vipp.c > +++ b/drivers/media/platform/xilinx/xilinx-vipp.c > @@ -312,36 +312,14 @@ static int xvip_graph_notify_complete(struct v4l2_async_notifier *notifier) > > static int xvip_graph_notify_bound(struct v4l2_async_notifier *notifier, > struct v4l2_subdev *subdev, > - struct v4l2_async_subdev *unused) > + struct v4l2_async_subdev *asd) > { > - struct xvip_composite_device *xdev = > - container_of(notifier, struct xvip_composite_device, notifier); > - struct xvip_graph_entity *entity; > - struct v4l2_async_subdev *asd; > + struct xvip_graph_entity *entity = to_xvip_entity(asd); > > - /* Locate the entity corresponding to the bound subdev and store the > - * subdev pointer. > - */ > - list_for_each_entry(asd, &xdev->notifier.asd_list, asd_list) { > - entity = to_xvip_entity(asd); > + entity->entity = &subdev->entity; > + entity->subdev = subdev; > > - if (entity->asd.match.fwnode != subdev->fwnode) > - continue; > - > - if (entity->subdev) { > - dev_err(xdev->dev, "duplicate subdev for node %p\n", > - entity->asd.match.fwnode); > - return -EINVAL; > - } > - > - dev_dbg(xdev->dev, "subdev %s bound\n", subdev->name); > - entity->entity = &subdev->entity; > - entity->subdev = subdev; > - return 0; > - } > - > - dev_err(xdev->dev, "no entity for subdev %s\n", subdev->name); > - return -EINVAL; > + return 0; > } > > static const struct v4l2_async_notifier_operations xvip_graph_notify_ops = {
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index 3123216b3f70e..b309af0c83749 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -312,36 +312,14 @@ static int xvip_graph_notify_complete(struct v4l2_async_notifier *notifier) static int xvip_graph_notify_bound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *subdev, - struct v4l2_async_subdev *unused) + struct v4l2_async_subdev *asd) { - struct xvip_composite_device *xdev = - container_of(notifier, struct xvip_composite_device, notifier); - struct xvip_graph_entity *entity; - struct v4l2_async_subdev *asd; + struct xvip_graph_entity *entity = to_xvip_entity(asd); - /* Locate the entity corresponding to the bound subdev and store the - * subdev pointer. - */ - list_for_each_entry(asd, &xdev->notifier.asd_list, asd_list) { - entity = to_xvip_entity(asd); + entity->entity = &subdev->entity; + entity->subdev = subdev; - if (entity->asd.match.fwnode != subdev->fwnode) - continue; - - if (entity->subdev) { - dev_err(xdev->dev, "duplicate subdev for node %p\n", - entity->asd.match.fwnode); - return -EINVAL; - } - - dev_dbg(xdev->dev, "subdev %s bound\n", subdev->name); - entity->entity = &subdev->entity; - entity->subdev = subdev; - return 0; - } - - dev_err(xdev->dev, "no entity for subdev %s\n", subdev->name); - return -EINVAL; + return 0; } static const struct v4l2_async_notifier_operations xvip_graph_notify_ops = {
The async notifier bound callback does a lot of checks that have probably been always unnecessary. Remove the lookup of the async subev that we already have, as well as the debug print that is already printed by the framework. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/platform/xilinx/xilinx-vipp.c | 32 ++++----------------- 1 file changed, 5 insertions(+), 27 deletions(-)