Re: [PATCH v9 2/2] input: joystick: Add ADC attached joystick driver.
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-09-14 20:35:49
Also in:
linux-devicetree, lkml
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-09-14 20:35:49
Also in:
linux-devicetree, lkml
On Sun, Sep 06, 2020 at 02:09:28PM +0200, Artur Rojek wrote:
Hi Andy, thanks for the review, replies inline. On 2020-09-06 11:22, Andy Shevchenko wrote:quoted
On Sat, Sep 5, 2020 at 7:34 PM Artur Rojek [off-list ref] wrote:quoted
+static int adc_joystick_open(struct input_dev *dev)quoted
+static void adc_joystick_close(struct input_dev *dev)Just wondering if this is protected against object lifetime cases.Can you clarify that in more details?
If there are lifetime issues they would be in input core, not individual driver. But input core ensures that it calls close (if open was called earlier) before doing input device teardown.
quoted
...quoted
+err:err_fwnode_put: ?quoted
+ fwnode_handle_put(child); + return ret;...quoted
+ /* Count how many channels we got. NULL terminated. */ + for (i = 0; joy->chans[i].indio_dev; ++i) { + bits = joy->chans[i].channel->scan_type.storagebits; + if (!bits || (bits > 16)) { + dev_err(dev, "Unsupported channel storage size\n");quoted
+ return -EINVAL;-ERANGE?
/* Math result not representable */ ? Seems not any better than -EINVAL. Thanks. -- Dmitry