[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <blpydhtx4iqc7izbjaccikwjkeninghdykjndcp4d6d33wbybu@legip3xo2fsr>
Date: Wed, 17 Sep 2025 22:20:48 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Stephan Gerhold <stephan.gerhold@...aro.org>
Cc: Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Henrik Rydberg <rydberg@...math.org>, Jeff LaBundy <jeff@...undy.com>,
Jonathan Albrieux <jonathan.albrieux@...il.com>, linux-input@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Stephan Gerhold <stephan@...hold.net>
Subject: Re: [PATCH v5 2/2] Input: add Himax HX852x(ES) touchscreen driver
Hi Stephan,
On Mon, Sep 15, 2025 at 04:19:57PM +0200, Stephan Gerhold wrote:
> +static int hx852x_i2c_read(struct hx852x *hx, u8 cmd, void *data, u16 len)
> +{
> + struct i2c_client *client = hx->client;
> + int ret;
> +
> + struct i2c_msg msg[] = {
> + {
> + .addr = client->addr,
> + .flags = 0,
> + .len = 1,
> + .buf = &cmd,
> + },
> + {
> + .addr = client->addr,
> + .flags = I2C_M_RD,
> + .len = len,
> + .buf = data,
> + },
> + };
> +
> + ret = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
> + if (ret != ARRAY_SIZE(msg)) {
Added
error = ret < 0 ? ret : -EIO;
because theoretically i2c_transfer() can return 0 as number of messages
transferred.
> +
> +err_test_mode:
> + error = i2c_smbus_write_byte_data(hx->client, HX852X_REG_SRAM_SWITCH, 0) ? : error;
You want to return the first error that happened, not the last one.
Changed to:
error2 = i2c_smbus_write_byte_data(...);
error = error ?: error2;
> +
> +static int hx852x_suspend(struct device *dev)
> +{
> + struct hx852x *hx = dev_get_drvdata(dev);
> + int error = 0;
> +
> + mutex_lock(&hx->input_dev->mutex);
Changed to use
guard(mutex)(&hx->input_dev->mutex);
style and applied.
Thanks.
--
Dmitry
Powered by blists - more mailing lists