Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: v4l2-core: cleanup coding style at V4L2 async/fwnode

There are several coding style issues at those definitions,
and the previous patchset added even more.

Address the trivial ones by first calling:

./scripts/checkpatch.pl --strict --fix-inline include/media/v4l2-async.h include/media/v4l2-fwnode.h include/media/v4l2-mediabus.h drivers/media/v4l2-core/v4l2-async.c drivers/media/v4l2-core/v4l2-fwnode.c

and then manually adjusting the style where needed.

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

+179 -141
+25 -20
drivers/media/v4l2-core/v4l2-async.c
··· 57 57 { 58 58 #if IS_ENABLED(CONFIG_I2C) 59 59 struct i2c_client *client = i2c_verify_client(sd->dev); 60 + 60 61 return client && 61 62 asd->match.i2c.adapter_id == client->adapter->nr && 62 63 asd->match.i2c.address == client->addr; ··· 90 89 static LIST_HEAD(notifier_list); 91 90 static DEFINE_MUTEX(list_lock); 92 91 93 - static struct v4l2_async_subdev *v4l2_async_find_match( 94 - struct v4l2_async_notifier *notifier, struct v4l2_subdev *sd) 92 + static struct v4l2_async_subdev * 93 + v4l2_async_find_match(struct v4l2_async_notifier *notifier, 94 + struct v4l2_subdev *sd) 95 95 { 96 - bool (*match)(struct v4l2_subdev *, struct v4l2_async_subdev *); 96 + bool (*match)(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd); 97 97 struct v4l2_async_subdev *asd; 98 98 99 99 list_for_each_entry(asd, &notifier->waiting, list) { ··· 152 150 } 153 151 154 152 /* Find the sub-device notifier registered by a sub-device driver. */ 155 - static struct v4l2_async_notifier *v4l2_async_find_subdev_notifier( 156 - struct v4l2_subdev *sd) 153 + static struct v4l2_async_notifier * 154 + v4l2_async_find_subdev_notifier(struct v4l2_subdev *sd) 157 155 { 158 156 struct v4l2_async_notifier *n; 159 157 ··· 165 163 } 166 164 167 165 /* Get v4l2_device related to the notifier if one can be found. */ 168 - static struct v4l2_device *v4l2_async_notifier_find_v4l2_dev( 169 - struct v4l2_async_notifier *notifier) 166 + static struct v4l2_device * 167 + v4l2_async_notifier_find_v4l2_dev(struct v4l2_async_notifier *notifier) 170 168 { 171 169 while (notifier->parent) 172 170 notifier = notifier->parent; ··· 177 175 /* 178 176 * Return true if all child sub-device notifiers are complete, false otherwise. 179 177 */ 180 - static bool v4l2_async_notifier_can_complete( 181 - struct v4l2_async_notifier *notifier) 178 + static bool 179 + v4l2_async_notifier_can_complete(struct v4l2_async_notifier *notifier) 182 180 { 183 181 struct v4l2_subdev *sd; 184 182 ··· 201 199 * Complete the master notifier if possible. This is done when all async 202 200 * sub-devices have been bound; v4l2_device is also available then. 203 201 */ 204 - static int v4l2_async_notifier_try_complete( 205 - struct v4l2_async_notifier *notifier) 202 + static int 203 + v4l2_async_notifier_try_complete(struct v4l2_async_notifier *notifier) 206 204 { 207 205 /* Quick check whether there are still more sub-devices here. */ 208 206 if (!list_empty(&notifier->waiting)) ··· 223 221 return v4l2_async_notifier_call_complete(notifier); 224 222 } 225 223 226 - static int v4l2_async_notifier_try_all_subdevs( 227 - struct v4l2_async_notifier *notifier); 224 + static int 225 + v4l2_async_notifier_try_all_subdevs(struct v4l2_async_notifier *notifier); 228 226 229 227 static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier, 230 228 struct v4l2_device *v4l2_dev, ··· 270 268 } 271 269 272 270 /* Test all async sub-devices in a notifier for a match. */ 273 - static int v4l2_async_notifier_try_all_subdevs( 274 - struct v4l2_async_notifier *notifier) 271 + static int 272 + v4l2_async_notifier_try_all_subdevs(struct v4l2_async_notifier *notifier) 275 273 { 276 274 struct v4l2_device *v4l2_dev = 277 275 v4l2_async_notifier_find_v4l2_dev(notifier); ··· 308 306 static void v4l2_async_cleanup(struct v4l2_subdev *sd) 309 307 { 310 308 v4l2_device_unregister_subdev(sd); 311 - /* Subdevice driver will reprobe and put the subdev back onto the list */ 309 + /* 310 + * Subdevice driver will reprobe and put the subdev back 311 + * onto the list 312 + */ 312 313 list_del_init(&sd->async_list); 313 314 sd->asd = NULL; 314 315 } 315 316 316 317 /* Unbind all sub-devices in the notifier tree. */ 317 - static void v4l2_async_notifier_unbind_all_subdevs( 318 - struct v4l2_async_notifier *notifier) 318 + static void 319 + v4l2_async_notifier_unbind_all_subdevs(struct v4l2_async_notifier *notifier) 319 320 { 320 321 struct v4l2_subdev *sd, *tmp; 321 322 ··· 513 508 } 514 509 EXPORT_SYMBOL(v4l2_async_subdev_notifier_register); 515 510 516 - static void __v4l2_async_notifier_unregister( 517 - struct v4l2_async_notifier *notifier) 511 + static void 512 + __v4l2_async_notifier_unregister(struct v4l2_async_notifier *notifier) 518 513 { 519 514 if (!notifier || (!notifier->v4l2_dev && !notifier->sd)) 520 515 return;
+106 -79
drivers/media/v4l2-core/v4l2-fwnode.c
··· 211 211 if (lanes_used & BIT(clock_lane)) { 212 212 if (have_clk_lane || !use_default_lane_mapping) 213 213 pr_warn("duplicated lane %u in clock-lanes, using defaults\n", 214 - v); 214 + v); 215 215 use_default_lane_mapping = true; 216 216 } 217 217 ··· 265 265 V4L2_MBUS_FIELD_EVEN_HIGH | \ 266 266 V4L2_MBUS_FIELD_EVEN_LOW) 267 267 268 - static void v4l2_fwnode_endpoint_parse_parallel_bus( 269 - struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep, 270 - enum v4l2_mbus_type bus_type) 268 + static void 269 + v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, 270 + struct v4l2_fwnode_endpoint *vep, 271 + enum v4l2_mbus_type bus_type) 271 272 { 272 273 struct v4l2_fwnode_bus_parallel *bus = &vep->bus.parallel; 273 274 unsigned int flags = 0; ··· 437 436 if (mbus_type != V4L2_MBUS_UNKNOWN && 438 437 vep->bus_type != mbus_type) { 439 438 pr_debug("expecting bus type %s\n", 440 - v4l2_fwnode_mbus_type_to_string( 441 - vep->bus_type)); 439 + v4l2_fwnode_mbus_type_to_string(vep->bus_type)); 442 440 return -ENXIO; 443 441 } 444 442 } else { ··· 452 452 return rval; 453 453 454 454 if (vep->bus_type == V4L2_MBUS_UNKNOWN) 455 - v4l2_fwnode_endpoint_parse_parallel_bus( 456 - fwnode, vep, V4L2_MBUS_UNKNOWN); 455 + v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep, 456 + V4L2_MBUS_UNKNOWN); 457 457 458 458 pr_debug("assuming media bus type %s (%u)\n", 459 459 v4l2_fwnode_mbus_type_to_string(vep->bus_type), ··· 511 511 } 512 512 EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_free); 513 513 514 - int v4l2_fwnode_endpoint_alloc_parse( 515 - struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep) 514 + int v4l2_fwnode_endpoint_alloc_parse(struct fwnode_handle *fwnode, 515 + struct v4l2_fwnode_endpoint *vep) 516 516 { 517 517 int rval; 518 518 ··· 533 533 534 534 vep->nr_of_link_frequencies = rval; 535 535 536 - rval = fwnode_property_read_u64_array( 537 - fwnode, "link-frequencies", vep->link_frequencies, 538 - vep->nr_of_link_frequencies); 536 + rval = fwnode_property_read_u64_array(fwnode, 537 + "link-frequencies", 538 + vep->link_frequencies, 539 + vep->nr_of_link_frequencies); 539 540 if (rval < 0) { 540 541 v4l2_fwnode_endpoint_free(vep); 541 542 return rval; ··· 594 593 } 595 594 EXPORT_SYMBOL_GPL(v4l2_fwnode_put_link); 596 595 597 - static int v4l2_async_notifier_fwnode_parse_endpoint( 598 - struct device *dev, struct v4l2_async_notifier *notifier, 599 - struct fwnode_handle *endpoint, unsigned int asd_struct_size, 600 - int (*parse_endpoint)(struct device *dev, 601 - struct v4l2_fwnode_endpoint *vep, 602 - struct v4l2_async_subdev *asd)) 596 + static int 597 + v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev, 598 + struct v4l2_async_notifier *notifier, 599 + struct fwnode_handle *endpoint, 600 + unsigned int asd_struct_size, 601 + int (*parse_endpoint)(struct device *dev, 602 + struct v4l2_fwnode_endpoint *vep, 603 + struct v4l2_async_subdev *asd)) 603 604 { 604 605 struct v4l2_fwnode_endpoint vep = { .bus_type = 0 }; 605 606 struct v4l2_async_subdev *asd; ··· 656 653 return ret == -ENOTCONN ? 0 : ret; 657 654 } 658 655 659 - static int __v4l2_async_notifier_parse_fwnode_endpoints( 660 - struct device *dev, struct v4l2_async_notifier *notifier, 661 - size_t asd_struct_size, unsigned int port, bool has_port, 662 - int (*parse_endpoint)(struct device *dev, 663 - struct v4l2_fwnode_endpoint *vep, 664 - struct v4l2_async_subdev *asd)) 656 + static int 657 + __v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, 658 + struct v4l2_async_notifier *notifier, 659 + size_t asd_struct_size, 660 + unsigned int port, bool has_port, 661 + int (*parse_endpoint)(struct device *dev, 662 + struct v4l2_fwnode_endpoint *vep, 663 + struct v4l2_async_subdev *asd)) 665 664 { 666 665 struct fwnode_handle *fwnode; 667 666 int ret = 0; ··· 692 687 continue; 693 688 } 694 689 695 - ret = v4l2_async_notifier_fwnode_parse_endpoint( 696 - dev, notifier, fwnode, asd_struct_size, parse_endpoint); 690 + ret = v4l2_async_notifier_fwnode_parse_endpoint(dev, 691 + notifier, 692 + fwnode, 693 + asd_struct_size, 694 + parse_endpoint); 697 695 if (ret < 0) 698 696 break; 699 697 } ··· 706 698 return ret; 707 699 } 708 700 709 - int v4l2_async_notifier_parse_fwnode_endpoints( 710 - struct device *dev, struct v4l2_async_notifier *notifier, 711 - size_t asd_struct_size, 712 - int (*parse_endpoint)(struct device *dev, 713 - struct v4l2_fwnode_endpoint *vep, 714 - struct v4l2_async_subdev *asd)) 701 + int 702 + v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, 703 + struct v4l2_async_notifier *notifier, 704 + size_t asd_struct_size, 705 + int (*parse_endpoint)(struct device *dev, 706 + struct v4l2_fwnode_endpoint *vep, 707 + struct v4l2_async_subdev *asd)) 715 708 { 716 - return __v4l2_async_notifier_parse_fwnode_endpoints( 717 - dev, notifier, asd_struct_size, 0, false, parse_endpoint); 709 + return __v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier, 710 + asd_struct_size, 0, 711 + false, 712 + parse_endpoint); 718 713 } 719 714 EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_endpoints); 720 715 721 - int v4l2_async_notifier_parse_fwnode_endpoints_by_port( 722 - struct device *dev, struct v4l2_async_notifier *notifier, 723 - size_t asd_struct_size, unsigned int port, 724 - int (*parse_endpoint)(struct device *dev, 725 - struct v4l2_fwnode_endpoint *vep, 726 - struct v4l2_async_subdev *asd)) 716 + int 717 + v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev, 718 + struct v4l2_async_notifier *notifier, 719 + size_t asd_struct_size, unsigned int port, 720 + int (*parse_endpoint)(struct device *dev, 721 + struct v4l2_fwnode_endpoint *vep, 722 + struct v4l2_async_subdev *asd)) 727 723 { 728 - return __v4l2_async_notifier_parse_fwnode_endpoints( 729 - dev, notifier, asd_struct_size, port, true, parse_endpoint); 724 + return __v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier, 725 + asd_struct_size, 726 + port, true, 727 + parse_endpoint); 730 728 } 731 729 EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_endpoints_by_port); 732 730 ··· 747 733 * -ENOMEM if memory allocation failed 748 734 * -EINVAL if property parsing failed 749 735 */ 750 - static int v4l2_fwnode_reference_parse( 751 - struct device *dev, struct v4l2_async_notifier *notifier, 752 - const char *prop) 736 + static int v4l2_fwnode_reference_parse(struct device *dev, 737 + struct v4l2_async_notifier *notifier, 738 + const char *prop) 753 739 { 754 740 struct fwnode_reference_args args; 755 741 unsigned int index; 756 742 int ret; 757 743 758 744 for (index = 0; 759 - !(ret = fwnode_property_get_reference_args( 760 - dev_fwnode(dev), prop, NULL, 0, index, &args)); 745 + !(ret = fwnode_property_get_reference_args(dev_fwnode(dev), 746 + prop, NULL, 0, 747 + index, &args)); 761 748 index++) 762 749 fwnode_handle_put(args.fwnode); 763 750 ··· 772 757 if (ret != -ENOENT && ret != -ENODATA) 773 758 return ret; 774 759 775 - for (index = 0; !fwnode_property_get_reference_args( 776 - dev_fwnode(dev), prop, NULL, 0, index, &args); 760 + for (index = 0; 761 + !fwnode_property_get_reference_args(dev_fwnode(dev), prop, NULL, 762 + 0, index, &args); 777 763 index++) { 778 764 struct v4l2_async_subdev *asd; 779 765 780 - asd = v4l2_async_notifier_add_fwnode_subdev( 781 - notifier, args.fwnode, sizeof(*asd)); 766 + asd = v4l2_async_notifier_add_fwnode_subdev(notifier, 767 + args.fwnode, 768 + sizeof(*asd)); 782 769 if (IS_ERR(asd)) { 783 770 ret = PTR_ERR(asd); 784 771 /* not an error if asd already exists */ ··· 956 939 * -EINVAL if property parsing otherwise failed 957 940 * -ENOMEM if memory allocation failed 958 941 */ 959 - static struct fwnode_handle *v4l2_fwnode_reference_get_int_prop( 960 - struct fwnode_handle *fwnode, const char *prop, unsigned int index, 961 - const char * const *props, unsigned int nprops) 942 + static struct fwnode_handle * 943 + v4l2_fwnode_reference_get_int_prop(struct fwnode_handle *fwnode, 944 + const char *prop, 945 + unsigned int index, 946 + const char * const *props, 947 + unsigned int nprops) 962 948 { 963 949 struct fwnode_reference_args fwnode_args; 964 950 u64 *args = fwnode_args.args; ··· 1036 1016 * -EINVAL if property parsing otherwisefailed 1037 1017 * -ENOMEM if memory allocation failed 1038 1018 */ 1039 - static int v4l2_fwnode_reference_parse_int_props( 1040 - struct device *dev, struct v4l2_async_notifier *notifier, 1041 - const char *prop, const char * const *props, unsigned int nprops) 1019 + static int 1020 + v4l2_fwnode_reference_parse_int_props(struct device *dev, 1021 + struct v4l2_async_notifier *notifier, 1022 + const char *prop, 1023 + const char * const *props, 1024 + unsigned int nprops) 1042 1025 { 1043 1026 struct fwnode_handle *fwnode; 1044 1027 unsigned int index; ··· 1067 1044 index++; 1068 1045 } while (1); 1069 1046 1070 - for (index = 0; !IS_ERR((fwnode = v4l2_fwnode_reference_get_int_prop( 1071 - dev_fwnode(dev), prop, index, props, 1072 - nprops))); index++) { 1047 + for (index = 0; 1048 + !IS_ERR((fwnode = v4l2_fwnode_reference_get_int_prop(dev_fwnode(dev), 1049 + prop, index, 1050 + props, 1051 + nprops))); 1052 + index++) { 1073 1053 struct v4l2_async_subdev *asd; 1074 1054 1075 1055 asd = v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, ··· 1096 1070 return ret; 1097 1071 } 1098 1072 1099 - int v4l2_async_notifier_parse_fwnode_sensor_common( 1100 - struct device *dev, struct v4l2_async_notifier *notifier) 1073 + int v4l2_async_notifier_parse_fwnode_sensor_common(struct device *dev, 1074 + struct v4l2_async_notifier *notifier) 1101 1075 { 1102 1076 static const char * const led_props[] = { "led" }; 1103 1077 static const struct { ··· 1114 1088 int ret; 1115 1089 1116 1090 if (props[i].props && is_acpi_node(dev_fwnode(dev))) 1117 - ret = v4l2_fwnode_reference_parse_int_props( 1118 - dev, notifier, props[i].name, 1119 - props[i].props, props[i].nprops); 1091 + ret = v4l2_fwnode_reference_parse_int_props(dev, 1092 + notifier, 1093 + props[i].name, 1094 + props[i].props, 1095 + props[i].nprops); 1120 1096 else 1121 - ret = v4l2_fwnode_reference_parse( 1122 - dev, notifier, props[i].name); 1097 + ret = v4l2_fwnode_reference_parse(dev, notifier, 1098 + props[i].name); 1123 1099 if (ret && ret != -ENOENT) { 1124 1100 dev_warn(dev, "parsing property \"%s\" failed (%d)\n", 1125 1101 props[i].name, ret); ··· 1175 1147 } 1176 1148 EXPORT_SYMBOL_GPL(v4l2_async_register_subdev_sensor_common); 1177 1149 1178 - int v4l2_async_register_fwnode_subdev( 1179 - struct v4l2_subdev *sd, size_t asd_struct_size, 1180 - unsigned int *ports, unsigned int num_ports, 1181 - int (*parse_endpoint)(struct device *dev, 1182 - struct v4l2_fwnode_endpoint *vep, 1183 - struct v4l2_async_subdev *asd)) 1150 + int v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd, 1151 + size_t asd_struct_size, 1152 + unsigned int *ports, unsigned int num_ports, 1153 + int (*parse_endpoint)(struct device *dev, 1154 + struct v4l2_fwnode_endpoint *vep, 1155 + struct v4l2_async_subdev *asd)) 1184 1156 { 1185 1157 struct v4l2_async_notifier *notifier; 1186 1158 struct device *dev = sd->dev; ··· 1201 1173 v4l2_async_notifier_init(notifier); 1202 1174 1203 1175 if (!ports) { 1204 - ret = v4l2_async_notifier_parse_fwnode_endpoints( 1205 - dev, notifier, asd_struct_size, parse_endpoint); 1176 + ret = v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier, 1177 + asd_struct_size, 1178 + parse_endpoint); 1206 1179 if (ret < 0) 1207 1180 goto out_cleanup; 1208 1181 } else { 1209 1182 unsigned int i; 1210 1183 1211 1184 for (i = 0; i < num_ports; i++) { 1212 - ret = v4l2_async_notifier_parse_fwnode_endpoints_by_port( 1213 - dev, notifier, asd_struct_size, 1214 - ports[i], parse_endpoint); 1185 + ret = v4l2_async_notifier_parse_fwnode_endpoints_by_port(dev, notifier, asd_struct_size, ports[i], parse_endpoint); 1215 1186 if (ret < 0) 1216 1187 goto out_cleanup; 1217 1188 }
+6 -6
include/media/v4l2-async.h
··· 89 89 unsigned short address; 90 90 } i2c; 91 91 struct { 92 - bool (*match)(struct device *, 93 - struct v4l2_async_subdev *); 92 + bool (*match)(struct device *dev, 93 + struct v4l2_async_subdev *sd); 94 94 void *priv; 95 95 } custom; 96 96 } match; ··· 222 222 const char *device_name, 223 223 unsigned int asd_struct_size); 224 224 225 - 226 225 /** 227 226 * v4l2_async_notifier_register - registers a subdevice asynchronous notifier 228 227 * ··· 242 243 struct v4l2_async_notifier *notifier); 243 244 244 245 /** 245 - * v4l2_async_notifier_unregister - unregisters a subdevice asynchronous notifier 246 + * v4l2_async_notifier_unregister - unregisters a subdevice 247 + * asynchronous notifier 246 248 * 247 249 * @notifier: pointer to &struct v4l2_async_notifier 248 250 */ ··· 294 294 * An error is returned if the module is no longer loaded on any attempts 295 295 * to register it. 296 296 */ 297 - int __must_check v4l2_async_register_subdev_sensor_common( 298 - struct v4l2_subdev *sd); 297 + int __must_check 298 + v4l2_async_register_subdev_sensor_common(struct v4l2_subdev *sd); 299 299 300 300 /** 301 301 * v4l2_async_unregister_subdev - unregisters a sub-device to the asynchronous
+24 -22
include/media/v4l2-fwnode.h
··· 71 71 * @clock_lane: the number of the clock lane 72 72 */ 73 73 struct v4l2_fwnode_bus_mipi_csi1 { 74 - bool clock_inv; 75 - bool strobe; 74 + unsigned char clock_inv:1; 75 + unsigned char strobe:1; 76 76 bool lane_polarity[2]; 77 77 unsigned char data_lane; 78 78 unsigned char clock_lane; ··· 203 203 * %-EINVAL on parsing failure 204 204 * %-ENXIO on mismatching bus types 205 205 */ 206 - int v4l2_fwnode_endpoint_alloc_parse( 207 - struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep); 206 + int v4l2_fwnode_endpoint_alloc_parse(struct fwnode_handle *fwnode, 207 + struct v4l2_fwnode_endpoint *vep); 208 208 209 209 /** 210 210 * v4l2_fwnode_parse_link() - parse a link between two endpoints ··· 236 236 */ 237 237 void v4l2_fwnode_put_link(struct v4l2_fwnode_link *link); 238 238 239 - 240 239 /** 241 240 * typedef parse_endpoint_func - Driver's callback function to be called on 242 241 * each V4L2 fwnode endpoint. ··· 253 254 typedef int (*parse_endpoint_func)(struct device *dev, 254 255 struct v4l2_fwnode_endpoint *vep, 255 256 struct v4l2_async_subdev *asd); 256 - 257 257 258 258 /** 259 259 * v4l2_async_notifier_parse_fwnode_endpoints - Parse V4L2 fwnode endpoints in a ··· 292 294 * %-EINVAL if graph or endpoint parsing failed 293 295 * Other error codes as returned by @parse_endpoint 294 296 */ 295 - int v4l2_async_notifier_parse_fwnode_endpoints( 296 - struct device *dev, struct v4l2_async_notifier *notifier, 297 - size_t asd_struct_size, 298 - parse_endpoint_func parse_endpoint); 297 + int 298 + v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, 299 + struct v4l2_async_notifier *notifier, 300 + size_t asd_struct_size, 301 + parse_endpoint_func parse_endpoint); 299 302 300 303 /** 301 304 * v4l2_async_notifier_parse_fwnode_endpoints_by_port - Parse V4L2 fwnode ··· 344 345 * %-EINVAL if graph or endpoint parsing failed 345 346 * Other error codes as returned by @parse_endpoint 346 347 */ 347 - int v4l2_async_notifier_parse_fwnode_endpoints_by_port( 348 - struct device *dev, struct v4l2_async_notifier *notifier, 349 - size_t asd_struct_size, unsigned int port, 350 - parse_endpoint_func parse_endpoint); 348 + int 349 + v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev, 350 + struct v4l2_async_notifier *notifier, 351 + size_t asd_struct_size, unsigned int port, 352 + parse_endpoint_func parse_endpoint); 351 353 352 354 /** 353 355 * v4l2_fwnode_reference_parse_sensor_common - parse common references on ··· 368 368 * -ENOMEM if memory allocation failed 369 369 * -EINVAL if property parsing failed 370 370 */ 371 - int v4l2_async_notifier_parse_fwnode_sensor_common( 372 - struct device *dev, struct v4l2_async_notifier *notifier); 371 + int v4l2_async_notifier_parse_fwnode_sensor_common(struct device *dev, 372 + struct v4l2_async_notifier *notifier); 373 373 374 374 /** 375 375 * v4l2_async_register_fwnode_subdev - registers a sub-device to the ··· 401 401 * An error is returned if the module is no longer loaded on any attempts 402 402 * to register it. 403 403 */ 404 - int v4l2_async_register_fwnode_subdev( 405 - struct v4l2_subdev *sd, size_t asd_struct_size, 406 - unsigned int *ports, unsigned int num_ports, 407 - int (*parse_endpoint)(struct device *dev, 408 - struct v4l2_fwnode_endpoint *vep, 409 - struct v4l2_async_subdev *asd)); 404 + int 405 + v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd, 406 + size_t asd_struct_size, 407 + unsigned int *ports, 408 + unsigned int num_ports, 409 + int (*parse_endpoint)(struct device *dev, 410 + struct v4l2_fwnode_endpoint *vep, 411 + struct v4l2_async_subdev *asd)); 410 412 411 413 #endif /* _V4L2_FWNODE_H */
+18 -14
include/media/v4l2-mediabus.h
··· 14 14 #include <linux/v4l2-mediabus.h> 15 15 #include <linux/bitops.h> 16 16 17 - 18 17 /* Parallel flags */ 19 18 /* 20 19 * Can the client run in master or in slave mode. By "Master mode" an operation ··· 62 63 #define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK BIT(8) 63 64 #define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK BIT(9) 64 65 65 - #define V4L2_MBUS_CSI2_LANES (V4L2_MBUS_CSI2_1_LANE | V4L2_MBUS_CSI2_2_LANE | \ 66 - V4L2_MBUS_CSI2_3_LANE | V4L2_MBUS_CSI2_4_LANE) 67 - #define V4L2_MBUS_CSI2_CHANNELS (V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1 | \ 68 - V4L2_MBUS_CSI2_CHANNEL_2 | V4L2_MBUS_CSI2_CHANNEL_3) 66 + #define V4L2_MBUS_CSI2_LANES (V4L2_MBUS_CSI2_1_LANE | \ 67 + V4L2_MBUS_CSI2_2_LANE | \ 68 + V4L2_MBUS_CSI2_3_LANE | \ 69 + V4L2_MBUS_CSI2_4_LANE) 70 + #define V4L2_MBUS_CSI2_CHANNELS (V4L2_MBUS_CSI2_CHANNEL_0 | \ 71 + V4L2_MBUS_CSI2_CHANNEL_1 | \ 72 + V4L2_MBUS_CSI2_CHANNEL_2 | \ 73 + V4L2_MBUS_CSI2_CHANNEL_3) 69 74 70 75 /** 71 76 * enum v4l2_mbus_type - media bus type ··· 109 106 * @pix_fmt: pointer to &struct v4l2_pix_format to be filled 110 107 * @mbus_fmt: pointer to &struct v4l2_mbus_framefmt to be used as model 111 108 */ 112 - static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, 113 - const struct v4l2_mbus_framefmt *mbus_fmt) 109 + static inline void 110 + v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, 111 + const struct v4l2_mbus_framefmt *mbus_fmt) 114 112 { 115 113 pix_fmt->width = mbus_fmt->width; 116 114 pix_fmt->height = mbus_fmt->height; ··· 132 128 * @code: data format code (from &enum v4l2_mbus_pixelcode) 133 129 */ 134 130 static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt, 135 - const struct v4l2_pix_format *pix_fmt, 131 + const struct v4l2_pix_format *pix_fmt, 136 132 u32 code) 137 133 { 138 134 mbus_fmt->width = pix_fmt->width; ··· 152 148 * @pix_mp_fmt: pointer to &struct v4l2_pix_format_mplane to be filled 153 149 * @mbus_fmt: pointer to &struct v4l2_mbus_framefmt to be used as model 154 150 */ 155 - static inline void v4l2_fill_pix_format_mplane( 156 - struct v4l2_pix_format_mplane *pix_mp_fmt, 157 - const struct v4l2_mbus_framefmt *mbus_fmt) 151 + static inline void 152 + v4l2_fill_pix_format_mplane(struct v4l2_pix_format_mplane *pix_mp_fmt, 153 + const struct v4l2_mbus_framefmt *mbus_fmt) 158 154 { 159 155 pix_mp_fmt->width = mbus_fmt->width; 160 156 pix_mp_fmt->height = mbus_fmt->height; ··· 172 168 * @mbus_fmt: pointer to &struct v4l2_mbus_framefmt to be filled 173 169 * @pix_mp_fmt: pointer to &struct v4l2_pix_format_mplane to be used as model 174 170 */ 175 - static inline void v4l2_fill_mbus_format_mplane( 176 - struct v4l2_mbus_framefmt *mbus_fmt, 177 - const struct v4l2_pix_format_mplane *pix_mp_fmt) 171 + static inline void 172 + v4l2_fill_mbus_format_mplane(struct v4l2_mbus_framefmt *mbus_fmt, 173 + const struct v4l2_pix_format_mplane *pix_mp_fmt) 178 174 { 179 175 mbus_fmt->width = pix_mp_fmt->width; 180 176 mbus_fmt->height = pix_mp_fmt->height;