Re: [PATCH v0 01/11] stm class: Introduce an abstraction for System Trace Module devices
From: Mathieu Poirier
Date: Fri Mar 20 2015 - 11:19:38 EST
On 20 March 2015 at 08:53, Alexander Shishkin
<alexander.shishkin@xxxxxxxxxxxxxxx> wrote:
> Mathieu Poirier <mathieu.poirier@xxxxxxxxxx> writes:
>
>> As promised I worked on a prototype that connects the coresight-stm
>> driver with the generic STM interface you have suggested. Things work
>> quite well and aside from the enhancement related to the ioctl() and
>> private member as discussed above, we should move ahead with this.
>>
>> I will send out a new version of the coresight-stm driver as soon as I
>> see your patches with those changes.
>
> Actually, instread of a private member I'd simply pass struct stm_data
> pointer to the callback (like we do with other callbacks) and the
> private data would be in the structure that embeds this struct stm_data,
> so that you can get to it using container_of():
>
> struct my_stm {
> struct stm_data data;
> void *my_stuff;
> ...
> };
>
> ...
>
> long my_ioctl(struct stm_data *data, unsigned int cmd, unsigned long
> arg)
> {
> struct my_stm *mine = container_of(data, struct my_stm, data);
>
> ...
>
> Would this work for you?
That should be just fine yes.
> I'm otherwise ready to send the second version
> of my patchset.
Cool
>
> Regards,
> --
> Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/