lkml.org 
[lkml]   [2020]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 4/4] Input: EXC3000: Add support to query model and fw_version
Hi Sebastian,

On Wed, Aug 05, 2020 at 06:05:20PM +0200, Sebastian Reichel wrote:
>
> +static int exc3000_query_interrupt(struct exc3000_data *data)
> +{
> + u8 *buf = data->buf;
> + int err;
> +
> + err = i2c_master_recv(data->client, buf, EXC3000_LEN_FRAME);
> + if (err < 0)
> + return err;
> +
> + if (buf[0] != 0x42)

I changed this to 'B' to match the rest of the function.

> + return -EPROTO;
> +
> + if (buf[4] == 'E')
> + strlcpy(data->model, buf+5, sizeof(data->model));
> + else if (buf[4] == 'D')
> + strlcpy(data->fw_version, buf+5, sizeof(data->fw_version));
> + else
> + return -EPROTO;
> +
> + return 0;
> +}
> +
> + error = sysfs_create_group(&client->dev.kobj, &exc3000_attribute_group);
> + if (error)
> + return error;
> +
> + error = devm_add_action_or_reset(&client->dev, exc3000_unregister_sysfs, &client->dev);
> + if (error)
> + return error;

Replaced 2 calls with devm_device_add_group().

Please yell if I managed to break it...

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2020-08-07 02:40    [W:0.088 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site