goto child_out;
}
- ret = fwnode_property_read_u32(child, "led-max-microamp",
- &led->full_scale_current);
-
- if (led->full_scale_current > LM3532_FS_CURR_MAX)
- led->full_scale_current = LM3532_FS_CURR_MAX;
+ if (fwnode_property_present(child, "led-max-microamp") &&
+ fwnode_property_read_u32(child, "led-max-microamp",
+ &led->full_scale_current))
+ dev_err(&priv->client->dev,
+ "Failed getting led-max-microamp\n");
+ else
+ led->full_scale_current = min(led->full_scale_current,
+ LM3532_FS_CURR_MAX);
if (led->mode == LM3532_BL_MODE_ALS) {
led->mode = LM3532_ALS_CTRL;