From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357AbbCTOx5 (ORCPT ); Fri, 20 Mar 2015 10:53:57 -0400 Received: from mga14.intel.com ([192.55.52.115]:40556 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbbCTOx4 (ORCPT ); Fri, 20 Mar 2015 10:53:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,437,1422950400"; d="scan'208";a="701697392" From: Alexander Shishkin To: Mathieu Poirier Cc: Greg Kroah-Hartman , "linux-kernel\@vger.kernel.org" , Pratik Patel , peter.lachner@intel.com, norbert.schulz@intel.com, keven.boell@intel.com, yann.fouassier@intel.com, laurent.fert@intel.com, linux-api@vger.kernel.org Subject: Re: [PATCH v0 01/11] stm class: Introduce an abstraction for System Trace Module devices In-Reply-To: References: <1425728161-164217-1-git-send-email-alexander.shishkin@linux.intel.com> <1425728161-164217-2-git-send-email-alexander.shishkin@linux.intel.com> <87mw3bewq8.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Fri, 20 Mar 2015 16:53:50 +0200 Message-ID: <87k2ybd8jl.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Poirier 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? I'm otherwise ready to send the second version of my patchset. Regards, -- Alex