Re: [PATCH v2 2/4] input: apple_z2: Add a driver for Apple Z2 touchscreens

From: Sasha Finkelstein
Date: Wed Dec 04 2024 - 04:32:03 EST


On Wed, 4 Dec 2024 at 00:07, Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
> > + z2->counter = 1 - z2->counter;
>
> Is this toggling between 1 and 0? Should it be "counter = !counter"? And
> is there better name than counter?

message_index_parity? Kind of a mouthful.

> > + .remove = apple_z2_shutdown,
>
> Purring the device into reset state before tearing down interrupt
> handler, etc, may lead to weird errors. Why do you need to do this on
> removal instead of letting devm tear down the device?

The interrupt is masked before putting the device into reset,
and i do need to put it into reset when removing it.