[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMdYzYquceSBrOsvO8rW9wmJA_RO=HSwv_waVoS=0hsP414T-A@mail.gmail.com>
Date: Fri, 14 Jan 2022 17:48:52 -0500
From: Peter Geis <pgwipeout@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [BUG] device_property_read_u16 reads out only zero
Good Evening,
I seem to have come across a strange bug with drivers/base/property.c
while expanding the new cyttsp5 driver to handle device-tree
overrides.
With the property:
touchscreen-size-x = <1863>;
The following code:
u32 test_u32 = 32; /* canary to catch writing a zero */
u16 test_u16 = 16; /* canary to catch writing a zero */
int ret;
ret = device_property_read_u32(ts->dev, "touchscreen-size-x", &test_u32);
if(ret)
dev_err(ts->dev, "read_u32 failed ret: %d\n", ret);
ret = device_property_read_u16(ts->dev, "touchscreen-size-x", &test_u16);
if(ret)
dev_err(ts->dev, "read_u16 failed ret: %d\n", ret);
dev_err(ts->dev, "read_u32: %d, read_u16: %d\n", test_u32, test_u16);
returns the following:
[ 1.010876] cyttsp5 5-0024: read_u32: 1863, read_u16: 0
This was as of 5.16-rc8, using the
gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu compiler.
I honestly am at a loss here, any insight you can provide here would
be appreciated.
Very Respectfully,
Peter Geis
Powered by blists - more mailing lists