Re: [PATCH v2 2/4] iio: hid-sensors: introduce device managed API

From: Andy Shevchenko

Date: Fri May 01 2026 - 08:35:08 EST


On Thu, Apr 30, 2026 at 10:30 PM Sanjay Chitroda
<sanjayembeddedse@xxxxxxxxx> wrote:
> On 30 April 2026 1:01:27 am IST, Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> >On Wed, Apr 29, 2026 at 11:29:16PM +0530, Sanjay Chitroda wrote:

...

> >> +static void hid_sensor_remove_trigger_action(void *ptr)
> >> +{
> >> + struct hid_sensor_common *attrb = ptr;
> >> +
> >> + hid_sensor_remove_trigger(attrb);
> >> +}
> >
> >Casting is not needed here.
> >
> >static void hid_sensor_remove_trigger_action(void *attrb)
> >{
> > hid_sensor_remove_trigger(attrb);
> >}
>
> True, the cast isn’t required. I kept the typed variable for clarity and type checking on devm_add.. API which pass void * callback and remove trigger API which has struct hid_sensor_common.
>
> Happy to simplify if preferred.

Please, do.

--
With Best Regards,
Andy Shevchenko