diff mbox series

[1/5] adv748x: Zero entire struct v4l2_fwnode_endpoint

Message ID 20200930144811.16612-2-sakari.ailus@linux.intel.com
State Superseded
Headers show
Series [1/5] adv748x: Zero entire struct v4l2_fwnode_endpoint | expand

Commit Message

Sakari Ailus Sept. 30, 2020, 2:48 p.m. UTC
The v4l2_fwnode_parse_endpoint() function can make use of defaults in
multiple bus types. To use this feature, all callers must zero the rest of
the fields of this struct, too. All other drivers appear to do that
already apart from this one.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/adv748x/adv748x-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Niklas Söderlund Oct. 2, 2020, 3:48 p.m. UTC | #1
Hi Sakari,

Thanks for your patch.

On 2020-09-30 17:48:07 +0300, Sakari Ailus wrote:
> The v4l2_fwnode_parse_endpoint() function can make use of defaults in

> multiple bus types. To use this feature, all callers must zero the rest of

> the fields of this struct, too. All other drivers appear to do that

> already apart from this one.

> 

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


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


> ---

>  drivers/media/i2c/adv748x/adv748x-core.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c

> index 1fe7f97c6d52..ae8b7ebf3830 100644

> --- a/drivers/media/i2c/adv748x/adv748x-core.c

> +++ b/drivers/media/i2c/adv748x/adv748x-core.c

> @@ -589,14 +589,13 @@ static int adv748x_parse_csi2_lanes(struct adv748x_state *state,

>  				    unsigned int port,

>  				    struct device_node *ep)

>  {

> -	struct v4l2_fwnode_endpoint vep;

> +	struct v4l2_fwnode_endpoint vep = { .bus_type = V4L2_MBUS_CSI2_DPHY };

>  	unsigned int num_lanes;

>  	int ret;

>  

>  	if (port != ADV748X_PORT_TXA && port != ADV748X_PORT_TXB)

>  		return 0;

>  

> -	vep.bus_type = V4L2_MBUS_CSI2_DPHY;

>  	ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &vep);

>  	if (ret)

>  		return ret;

> -- 

> 2.27.0

> 

> 


-- 
Regards,
Niklas Söderlund
Laurent Pinchart Oct. 4, 2020, 8:31 a.m. UTC | #2
Hi Sakari,

Thank you for the patch.

On Wed, Sep 30, 2020 at 05:48:07PM +0300, Sakari Ailus wrote:
> The v4l2_fwnode_parse_endpoint() function can make use of defaults in
> multiple bus types. To use this feature, all callers must zero the rest of
> the fields of this struct, too. All other drivers appear to do that
> already apart from this one.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/adv748x/adv748x-core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
> index 1fe7f97c6d52..ae8b7ebf3830 100644
> --- a/drivers/media/i2c/adv748x/adv748x-core.c
> +++ b/drivers/media/i2c/adv748x/adv748x-core.c
> @@ -589,14 +589,13 @@ static int adv748x_parse_csi2_lanes(struct adv748x_state *state,
>  				    unsigned int port,
>  				    struct device_node *ep)
>  {
> -	struct v4l2_fwnode_endpoint vep;
> +	struct v4l2_fwnode_endpoint vep = { .bus_type = V4L2_MBUS_CSI2_DPHY };
>  	unsigned int num_lanes;
>  	int ret;
>  
>  	if (port != ADV748X_PORT_TXA && port != ADV748X_PORT_TXB)
>  		return 0;
>  
> -	vep.bus_type = V4L2_MBUS_CSI2_DPHY;
>  	ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &vep);
>  	if (ret)
>  		return ret;
diff mbox series

Patch

diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index 1fe7f97c6d52..ae8b7ebf3830 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -589,14 +589,13 @@  static int adv748x_parse_csi2_lanes(struct adv748x_state *state,
 				    unsigned int port,
 				    struct device_node *ep)
 {
-	struct v4l2_fwnode_endpoint vep;
+	struct v4l2_fwnode_endpoint vep = { .bus_type = V4L2_MBUS_CSI2_DPHY };
 	unsigned int num_lanes;
 	int ret;
 
 	if (port != ADV748X_PORT_TXA && port != ADV748X_PORT_TXB)
 		return 0;
 
-	vep.bus_type = V4L2_MBUS_CSI2_DPHY;
 	ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &vep);
 	if (ret)
 		return ret;