diff mbox series

[v3,5/6] media: rcar-vin: Remove explicit device availability check

Message ID 20210624084046.13136-6-sakari.ailus@linux.intel.com
State New
Headers show
Series V4L2 driver documentation, v4l2-async improvements | expand

Commit Message

Sakari Ailus June 24, 2021, 8:40 a.m. UTC
From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

The fwnode is retrieved using fwnode_graph_get_endpoint_by_id() without
the FWNODE_GRAPH_DEVICE_DISABLED flag set. So there is no need to
explicitly check if the fwnode is available as it always will be when
the check is performed, remove it.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/platform/rcar-vin/rcar-core.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Kieran Bingham July 27, 2021, 12:53 p.m. UTC | #1
On 24/06/2021 09:40, Sakari Ailus wrote:
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> 

> The fwnode is retrieved using fwnode_graph_get_endpoint_by_id() without

> the FWNODE_GRAPH_DEVICE_DISABLED flag set. So there is no need to

> explicitly check if the fwnode is available as it always will be when

> the check is performed, remove it.


Interestingly I don't see any users of FWNODE_GRAPH_DEVICE_DISABLED ...
I guess it's just there in case someone does one day need it.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>



> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

> ---

>  drivers/media/platform/rcar-vin/rcar-core.c | 7 -------

>  1 file changed, 7 deletions(-)

> 

> diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c

> index 3b7052ff7117..a24aeda37e74 100644

> --- a/drivers/media/platform/rcar-vin/rcar-core.c

> +++ b/drivers/media/platform/rcar-vin/rcar-core.c

> @@ -834,13 +834,6 @@ static int rvin_mc_parse_of(struct rvin_dev *vin, unsigned int id)

>  		goto out;

>  	}

>  

> -	if (!of_device_is_available(to_of_node(fwnode))) {

> -		vin_dbg(vin, "OF device %pOF disabled, ignoring\n",

> -			to_of_node(fwnode));

> -		ret = -ENOTCONN;

> -		goto out;

> -	}

> -

>  	asd = v4l2_async_nf_add_fwnode(&vin->group->notifier, fwnode,

>  				       struct v4l2_async_subdev);

>  	if (IS_ERR(asd)) {

>
diff mbox series

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index 3b7052ff7117..a24aeda37e74 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -834,13 +834,6 @@  static int rvin_mc_parse_of(struct rvin_dev *vin, unsigned int id)
 		goto out;
 	}
 
-	if (!of_device_is_available(to_of_node(fwnode))) {
-		vin_dbg(vin, "OF device %pOF disabled, ignoring\n",
-			to_of_node(fwnode));
-		ret = -ENOTCONN;
-		goto out;
-	}
-
 	asd = v4l2_async_nf_add_fwnode(&vin->group->notifier, fwnode,
 				       struct v4l2_async_subdev);
 	if (IS_ERR(asd)) {