Merge "leds: leds-qpnp-wled: correct various coding style issues"

This commit is contained in:
Linux Build Service Account 2017-02-08 17:47:44 -08:00 committed by Gerrit - the friendly Code Review server
commit 2c9038e7d1
2 changed files with 26 additions and 33 deletions

View file

@ -619,11 +619,10 @@ config LEDS_QPNP_WLED
tristate "Support for QPNP WLED"
depends on LEDS_CLASS && SPMI
help
This driver supports the WLED (White LED) functionality of
Qualcomm Technologies PNP PMIC. WLED is used for display backlight.
To compile this driver as a module, choose M here: the module will
be called leds-qpnp-wled.
This driver supports the WLED (White LED) functionality of Qualcomm
Technologies, Inc. QPNP PMICs. WLED is used for LCD backlight with
variable brightness. It also supports outputting the Avdd supply for
AMOLED displays.
config LEDS_SYSCON
bool "LED support for LEDs on system controllers"

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -721,10 +721,11 @@ static ssize_t qpnp_wled_ramp_ms_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct qpnp_wled *wled = dev_get_drvdata(dev);
int data;
int data, rc;
if (sscanf(buf, "%d", &data) != 1)
return -EINVAL;
rc = kstrtoint(buf, 10, &data);
if (rc)
return rc;
wled->ramp_ms = data;
return count;
@ -744,10 +745,11 @@ static ssize_t qpnp_wled_ramp_step_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct qpnp_wled *wled = dev_get_drvdata(dev);
int data;
int data, rc;
if (sscanf(buf, "%d", &data) != 1)
return -EINVAL;
rc = kstrtoint(buf, 10, &data);
if (rc)
return rc;
wled->ramp_step = data;
return count;
@ -832,8 +834,9 @@ static ssize_t qpnp_wled_fs_curr_ua_store(struct device *dev,
int data, i, rc, temp;
u8 reg;
if (sscanf(buf, "%d", &data) != 1)
return -EINVAL;
rc = kstrtoint(buf, 10, &data);
if (rc)
return rc;
for (i = 0; i < wled->num_strings; i++) {
if (data < QPNP_WLED_FS_CURR_MIN_UA)
@ -869,23 +872,14 @@ static ssize_t qpnp_wled_fs_curr_ua_store(struct device *dev,
/* sysfs attributes exported by wled */
static struct device_attribute qpnp_wled_attrs[] = {
__ATTR(dump_regs, (S_IRUGO | S_IWUSR | S_IWGRP),
qpnp_wled_dump_regs_show,
NULL),
__ATTR(dim_mode, (S_IRUGO | S_IWUSR | S_IWGRP),
qpnp_wled_dim_mode_show,
__ATTR(dump_regs, 0664, qpnp_wled_dump_regs_show, NULL),
__ATTR(dim_mode, 0664, qpnp_wled_dim_mode_show,
qpnp_wled_dim_mode_store),
__ATTR(fs_curr_ua, (S_IRUGO | S_IWUSR | S_IWGRP),
qpnp_wled_fs_curr_ua_show,
__ATTR(fs_curr_ua, 0664, qpnp_wled_fs_curr_ua_show,
qpnp_wled_fs_curr_ua_store),
__ATTR(start_ramp, (S_IRUGO | S_IWUSR | S_IWGRP),
NULL,
qpnp_wled_ramp_store),
__ATTR(ramp_ms, (S_IRUGO | S_IWUSR | S_IWGRP),
qpnp_wled_ramp_ms_show,
qpnp_wled_ramp_ms_store),
__ATTR(ramp_step, (S_IRUGO | S_IWUSR | S_IWGRP),
qpnp_wled_ramp_step_show,
__ATTR(start_ramp, 0664, NULL, qpnp_wled_ramp_store),
__ATTR(ramp_ms, 0664, qpnp_wled_ramp_ms_show, qpnp_wled_ramp_ms_store),
__ATTR(ramp_step, 0664, qpnp_wled_ramp_step_show,
qpnp_wled_ramp_step_store),
};
@ -2196,7 +2190,7 @@ static int qpnp_wled_remove(struct platform_device *pdev)
return 0;
}
static struct of_device_id spmi_match_table[] = {
static const struct of_device_id spmi_match_table[] = {
{ .compatible = "qcom,qpnp-wled",},
{ },
};