lkml.org 
[lkml]   [2018]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 2/2] leds: lm3697: Introduce the lm3697 driver
From
Date
Jacek

On 08/24/2018 05:05 AM, Pavel Machek wrote:
> Hi!
>
>> +/**
>> + * struct lm3697 -
>> + * @enable_gpio - Hardware enable gpio
>> + * @regulator - LED supply regulator pointer
>> + * @client - Pointer to the I2C client
>> + * @regmap - Devices register map
>> + * @dev - Pointer to the devices device struct
>> + * @lock - Lock for reading/writing the device
>> + * @leds - Array of LED strings.
>> + */
>
> extra .
>
>> + ret = regmap_write(led->priv->regmap, brt_msb_reg, brt_val);
>> + if (ret) {
>> + dev_err(&led->priv->client->dev, "Cannot write MSB\n");
>> + goto out;
>> + }
>> +out:
>
> I'd avoid this goto.
>
>> +static int lm3697_set_control_bank(struct lm3697 *priv)
>> +{
>> + u8 control_bank_config = 0;
>> + struct lm3697_led *led;
>> + int ret, i;
>> +
>> + led = &priv->leds[0];
>> + if (led->control_bank == LM3697_CONTROL_A)
>> + led = &priv->leds[1];
>
> I'd expect CONTROL_A to correspond to leds[0]...?
>
>> + for (i = 0; i < LM3697_MAX_LED_STRINGS; i++) {
>> + if (led->hvled_strings[i] == LM3697_HVLED_ASSIGNMENT)
>> + control_bank_config |= 1 << i;
>> + }
>
> Extra {}s.
>
>> + priv->regulator = devm_regulator_get(&priv->client->dev, "vled");
>> + if (IS_ERR(priv->regulator))
>> + priv->regulator = NULL;
>
> If vled regulator is specified in dt and _get fails, is it worth a
> warning?
>
> Pavel
>

Do you want v6 or a new patch on top?

Dan

--
------------------
Dan Murphy

\
 
 \ /
  Last update: 2018-08-24 13:59    [W:0.117 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site