vim +1130 drivers/leds/leds-lp55xx-common.c
1111
1112 static int lp55xx_parse_common_child(struct device_node *np,
1113 struct lp55xx_led_config *cfg,
1114 int led_number, int *chan_nr)
1115 {
1116 int ret;
1117
1118 of_property_read_string(np, "chan-name",
1119 &cfg[led_number].name);
1120 of_property_read_u8(np, "led-cur",
1121 &cfg[led_number].led_current);
1122 of_property_read_u8(np, "max-cur",
1123 &cfg[led_number].max_current);
1124
1125 ret = of_property_read_u32(np, "reg", chan_nr);
1126 if (ret)
1127 return ret;
1128
1129 if (*chan_nr < 0 || *chan_nr >= cfg->max_channel) {
1130 dev_err(dev, "Use channel numbers between 0 and %d\n",
1131 cfg->max_channel - 1);
1132 return -EINVAL;
1133 }
1134
1135 return 0;
1136 }
1137