Loading drivers/leds/leds-qpnp-flash.c +9 −24 Original line number Diff line number Diff line Loading @@ -823,7 +823,7 @@ static struct device_attribute qpnp_flash_led_attrs[] = { qpnp_flash_led_die_temp_store), }; static int qpnp_flash_led_get_thermal_derate_rate(const char *rate) static u32 qpnp_flash_led_get_thermal_derate_rate(const char *rate) { /* * return 5% derate as default value if user specifies Loading @@ -843,7 +843,7 @@ static int qpnp_flash_led_get_thermal_derate_rate(const char *rate) return RATE_5_PERCENT; } static int qpnp_flash_led_get_ramp_step(const char *step) static u32 qpnp_flash_led_get_ramp_step(const char *step) { /* * return 27 us as default value if user specifies Loading Loading @@ -2164,12 +2164,6 @@ static int qpnp_flash_led_parse_common_dt( if (!rc) { temp_val = qpnp_flash_led_get_thermal_derate_rate(temp); if (temp_val < 0) { dev_err(&led->spmi_dev->dev, "Invalid thermal derate rate\n"); return -EINVAL; } led->pdata->thermal_derate_rate = (u8)temp_val; } else { dev_err(&led->spmi_dev->dev, Loading Loading @@ -2198,11 +2192,6 @@ static int qpnp_flash_led_parse_common_dt( rc = of_property_read_string(node, "qcom,ramp_up_step", &temp); if (!rc) { temp_val = qpnp_flash_led_get_ramp_step(temp); if (temp_val < 0) { dev_err(&led->spmi_dev->dev, "Invalid ramp up step values\n"); return -EINVAL; } led->pdata->ramp_up_step = (u8)temp_val; } else if (rc != -EINVAL) { dev_err(&led->spmi_dev->dev, Loading @@ -2214,11 +2203,6 @@ static int qpnp_flash_led_parse_common_dt( rc = of_property_read_string(node, "qcom,ramp_dn_step", &temp); if (!rc) { temp_val = qpnp_flash_led_get_ramp_step(temp); if (temp_val < 0) { dev_err(&led->spmi_dev->dev, "Invalid ramp down step values\n"); return rc; } led->pdata->ramp_dn_step = (u8)temp_val; } else if (rc != -EINVAL) { dev_err(&led->spmi_dev->dev, Loading Loading @@ -2420,12 +2404,12 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) return -ENOMEM; } led->peripheral_type = (u8)qpnp_flash_led_get_peripheral_type(led); if (led->peripheral_type < 0) { rc = qpnp_flash_led_get_peripheral_type(led); if (rc < 0) { dev_err(&spmi->dev, "Failed to get peripheral type\n"); return rc; } led->peripheral_type = (u8) rc; rc = qpnp_flash_led_parse_common_dt(led, node); if (rc) { Loading Loading @@ -2469,6 +2453,7 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) } for_each_child_of_node(node, temp) { j = -1; led->flash_node[i].cdev.brightness_set = qpnp_flash_led_brightness_set; led->flash_node[i].cdev.brightness_get = Loading Loading @@ -2544,7 +2529,6 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) if (rc) goto error_led_register; } i++; } Loading @@ -2556,7 +2540,7 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) (long)root); if (PTR_ERR(root) == -ENODEV) pr_err("debugfs is not enabled in kernel"); goto error_led_debugfs; goto error_free_led_sysfs; } led->dbgfs_root = root; Loading Loading @@ -2586,6 +2570,8 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) return 0; error_led_debugfs: debugfs_remove_recursive(root); error_free_led_sysfs: i = led->num_leds - 1; j = ARRAY_SIZE(qpnp_flash_led_attrs) - 1; error_led_register: Loading @@ -2596,7 +2582,6 @@ error_led_register: j = ARRAY_SIZE(qpnp_flash_led_attrs) - 1; led_classdev_unregister(&led->flash_node[i].cdev); } debugfs_remove_recursive(root); mutex_destroy(&led->flash_led_lock); destroy_workqueue(led->ordered_workq); Loading Loading
drivers/leds/leds-qpnp-flash.c +9 −24 Original line number Diff line number Diff line Loading @@ -823,7 +823,7 @@ static struct device_attribute qpnp_flash_led_attrs[] = { qpnp_flash_led_die_temp_store), }; static int qpnp_flash_led_get_thermal_derate_rate(const char *rate) static u32 qpnp_flash_led_get_thermal_derate_rate(const char *rate) { /* * return 5% derate as default value if user specifies Loading @@ -843,7 +843,7 @@ static int qpnp_flash_led_get_thermal_derate_rate(const char *rate) return RATE_5_PERCENT; } static int qpnp_flash_led_get_ramp_step(const char *step) static u32 qpnp_flash_led_get_ramp_step(const char *step) { /* * return 27 us as default value if user specifies Loading Loading @@ -2164,12 +2164,6 @@ static int qpnp_flash_led_parse_common_dt( if (!rc) { temp_val = qpnp_flash_led_get_thermal_derate_rate(temp); if (temp_val < 0) { dev_err(&led->spmi_dev->dev, "Invalid thermal derate rate\n"); return -EINVAL; } led->pdata->thermal_derate_rate = (u8)temp_val; } else { dev_err(&led->spmi_dev->dev, Loading Loading @@ -2198,11 +2192,6 @@ static int qpnp_flash_led_parse_common_dt( rc = of_property_read_string(node, "qcom,ramp_up_step", &temp); if (!rc) { temp_val = qpnp_flash_led_get_ramp_step(temp); if (temp_val < 0) { dev_err(&led->spmi_dev->dev, "Invalid ramp up step values\n"); return -EINVAL; } led->pdata->ramp_up_step = (u8)temp_val; } else if (rc != -EINVAL) { dev_err(&led->spmi_dev->dev, Loading @@ -2214,11 +2203,6 @@ static int qpnp_flash_led_parse_common_dt( rc = of_property_read_string(node, "qcom,ramp_dn_step", &temp); if (!rc) { temp_val = qpnp_flash_led_get_ramp_step(temp); if (temp_val < 0) { dev_err(&led->spmi_dev->dev, "Invalid ramp down step values\n"); return rc; } led->pdata->ramp_dn_step = (u8)temp_val; } else if (rc != -EINVAL) { dev_err(&led->spmi_dev->dev, Loading Loading @@ -2420,12 +2404,12 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) return -ENOMEM; } led->peripheral_type = (u8)qpnp_flash_led_get_peripheral_type(led); if (led->peripheral_type < 0) { rc = qpnp_flash_led_get_peripheral_type(led); if (rc < 0) { dev_err(&spmi->dev, "Failed to get peripheral type\n"); return rc; } led->peripheral_type = (u8) rc; rc = qpnp_flash_led_parse_common_dt(led, node); if (rc) { Loading Loading @@ -2469,6 +2453,7 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) } for_each_child_of_node(node, temp) { j = -1; led->flash_node[i].cdev.brightness_set = qpnp_flash_led_brightness_set; led->flash_node[i].cdev.brightness_get = Loading Loading @@ -2544,7 +2529,6 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) if (rc) goto error_led_register; } i++; } Loading @@ -2556,7 +2540,7 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) (long)root); if (PTR_ERR(root) == -ENODEV) pr_err("debugfs is not enabled in kernel"); goto error_led_debugfs; goto error_free_led_sysfs; } led->dbgfs_root = root; Loading Loading @@ -2586,6 +2570,8 @@ static int qpnp_flash_led_probe(struct spmi_device *spmi) return 0; error_led_debugfs: debugfs_remove_recursive(root); error_free_led_sysfs: i = led->num_leds - 1; j = ARRAY_SIZE(qpnp_flash_led_attrs) - 1; error_led_register: Loading @@ -2596,7 +2582,6 @@ error_led_register: j = ARRAY_SIZE(qpnp_flash_led_attrs) - 1; led_classdev_unregister(&led->flash_node[i].cdev); } debugfs_remove_recursive(root); mutex_destroy(&led->flash_led_lock); destroy_workqueue(led->ordered_workq); Loading