diff mbox series

[2/3] v4l2-fwnode: Make bus configuration a struct

Message ID 20200908085121.864-3-sakari.ailus@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Improve V4L2 fwnode framework usability and documentation | expand

Commit Message

Sakari Ailus Sept. 8, 2020, 8:51 a.m. UTC
The bus specific parameters were an union. This made providing bus
specific defaults impossible as the memory used to store the defaults for
multiple different busses was the same.

Make it struct instead. It's not large so the size isn't really an issue.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 include/media/v4l2-fwnode.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Sept. 8, 2020, 12:47 p.m. UTC | #1
Hi Sakari,

Thank you for the patch.

On Tue, Sep 08, 2020 at 11:51:20AM +0300, Sakari Ailus wrote:
> The bus specific parameters were an union. This made providing bus
> specific defaults impossible as the memory used to store the defaults for
> multiple different busses was the same.
> 
> Make it struct instead. It's not large so the size isn't really an issue.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

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

> ---
>  include/media/v4l2-fwnode.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
> index 81e7eb123294..d04f39b60096 100644
> --- a/include/media/v4l2-fwnode.h
> +++ b/include/media/v4l2-fwnode.h
> @@ -78,7 +78,7 @@ struct v4l2_fwnode_bus_mipi_csi1 {
>   * struct v4l2_fwnode_endpoint - the endpoint data structure
>   * @base: fwnode endpoint of the v4l2_fwnode
>   * @bus_type: bus type
> - * @bus: union with bus configuration data structure
> + * @bus: bus configuration data structure
>   * @bus.parallel: embedded &struct v4l2_fwnode_bus_parallel.
>   *		  Used if the bus is parallel.
>   * @bus.mipi_csi1: embedded &struct v4l2_fwnode_bus_mipi_csi1.
> @@ -99,7 +99,7 @@ struct v4l2_fwnode_endpoint {
>  	 * v4l2_fwnode_endpoint_parse()
>  	 */
>  	enum v4l2_mbus_type bus_type;
> -	union {
> +	struct {
>  		struct v4l2_fwnode_bus_parallel parallel;
>  		struct v4l2_fwnode_bus_mipi_csi1 mipi_csi1;
>  		struct v4l2_fwnode_bus_mipi_csi2 mipi_csi2;
diff mbox series

Patch

diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index 81e7eb123294..d04f39b60096 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -78,7 +78,7 @@  struct v4l2_fwnode_bus_mipi_csi1 {
  * struct v4l2_fwnode_endpoint - the endpoint data structure
  * @base: fwnode endpoint of the v4l2_fwnode
  * @bus_type: bus type
- * @bus: union with bus configuration data structure
+ * @bus: bus configuration data structure
  * @bus.parallel: embedded &struct v4l2_fwnode_bus_parallel.
  *		  Used if the bus is parallel.
  * @bus.mipi_csi1: embedded &struct v4l2_fwnode_bus_mipi_csi1.
@@ -99,7 +99,7 @@  struct v4l2_fwnode_endpoint {
 	 * v4l2_fwnode_endpoint_parse()
 	 */
 	enum v4l2_mbus_type bus_type;
-	union {
+	struct {
 		struct v4l2_fwnode_bus_parallel parallel;
 		struct v4l2_fwnode_bus_mipi_csi1 mipi_csi1;
 		struct v4l2_fwnode_bus_mipi_csi2 mipi_csi2;