Skip to content

Commit

Permalink
media: v4l: fwnode: Use a less clash-prone name for MAX_DATA_LANES macro
Browse files Browse the repository at this point in the history
Avoid using a generic name such as MAX_DATA_LANES in a header file widely
included in drivers. Instead, call it V4L2_FWNODE_CSI2_MAX_DATA_LANES.

Fixes: 4ee2362 ("media: v4l2-fwnode: suppress a warning at OF parsing logic")

Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Sakari Ailus authored and mchehab committed Aug 26, 2017
1 parent 1526c70 commit ad3cdf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions drivers/media/v4l2-core/v4l2-fwnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,

rval = fwnode_property_read_u32_array(fwnode, "data-lanes", NULL, 0);
if (rval > 0) {
u32 array[1 + MAX_DATA_LANES];
u32 array[1 + V4L2_FWNODE_CSI2_MAX_DATA_LANES];

bus->num_data_lanes = min_t(int, MAX_DATA_LANES, rval);
bus->num_data_lanes =
min_t(int, V4L2_FWNODE_CSI2_MAX_DATA_LANES, rval);

fwnode_property_read_u32_array(fwnode, "data-lanes", array,
bus->num_data_lanes);
Expand Down
6 changes: 3 additions & 3 deletions include/media/v4l2-fwnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

struct fwnode_handle;

#define MAX_DATA_LANES 4
#define V4L2_FWNODE_CSI2_MAX_DATA_LANES 4

/**
* struct v4l2_fwnode_bus_mipi_csi2 - MIPI CSI-2 bus data structure
Expand All @@ -39,10 +39,10 @@ struct fwnode_handle;
*/
struct v4l2_fwnode_bus_mipi_csi2 {
unsigned int flags;
unsigned char data_lanes[MAX_DATA_LANES];
unsigned char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES];
unsigned char clock_lane;
unsigned short num_data_lanes;
bool lane_polarities[1 + MAX_DATA_LANES];
bool lane_polarities[1 + V4L2_FWNODE_CSI2_MAX_DATA_LANES];
};

/**
Expand Down

0 comments on commit ad3cdf3

Please sign in to comment.