Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Samuel Ortiz
On Mon, Feb 11, 2013 at 08:03:46AM -0800, Greg KH wrote:
> On Mon, Feb 11, 2013 at 04:29:29PM +0100, Samuel Ortiz wrote:
> > Hi Arnd,
> > 
> > On Mon, Feb 11, 2013 at 02:58:37PM +, Arnd Bergmann wrote:
> > > On Thursday 07 February 2013, Samuel Ortiz wrote:
> > > > 
> > > > On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
> > > > > On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
> > > > > > On Thursday 07 February 2013, Tomas Winkler wrote:
> > > > > > > 
> > > > > > > +inline void *mei_bus_get_clientdata(const struct mei_bus_client 
> > > > > > > *client)
> > > > > > > +{
> > > > > > > +   return dev_get_drvdata(>dev);
> > > > > > > +}
> > > > > > > +EXPORT_SYMBOL(mei_bus_get_clientdata);
> > > > > > > +
> > > > > > 
> > > > > > Did you really mean to export an inline function?
> > > > > > 
> > > > > > Can you make this a static inline function in a header file instead?
> > > > > Sure, will do.
> > > > Actually, I'd like to keep the mei_bus_client structure opaque to the 
> > > > MEI bus
> > > > drivers. So I'll still export those symbols without inlining them.
> > > 
> > > Ok, makes sense. I assume when you say "bus driver" you mean what other
> > > subsystems call a "device driver".
> > That's correct, yes.
> 
> Thanks for clearing that up.  So, in your next revision, can you use the
> "proper" names for everything so that we all can understand the code
> easier as it will follow the normal standards for kernel driver model
> interaction?
I will certainly do that, yes.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Greg KH
On Mon, Feb 11, 2013 at 04:29:29PM +0100, Samuel Ortiz wrote:
> Hi Arnd,
> 
> On Mon, Feb 11, 2013 at 02:58:37PM +, Arnd Bergmann wrote:
> > On Thursday 07 February 2013, Samuel Ortiz wrote:
> > > 
> > > On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
> > > > On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
> > > > > On Thursday 07 February 2013, Tomas Winkler wrote:
> > > > > > 
> > > > > > +inline void *mei_bus_get_clientdata(const struct mei_bus_client 
> > > > > > *client)
> > > > > > +{
> > > > > > +   return dev_get_drvdata(>dev);
> > > > > > +}
> > > > > > +EXPORT_SYMBOL(mei_bus_get_clientdata);
> > > > > > +
> > > > > 
> > > > > Did you really mean to export an inline function?
> > > > > 
> > > > > Can you make this a static inline function in a header file instead?
> > > > Sure, will do.
> > > Actually, I'd like to keep the mei_bus_client structure opaque to the MEI 
> > > bus
> > > drivers. So I'll still export those symbols without inlining them.
> > 
> > Ok, makes sense. I assume when you say "bus driver" you mean what other
> > subsystems call a "device driver".
> That's correct, yes.

Thanks for clearing that up.  So, in your next revision, can you use the
"proper" names for everything so that we all can understand the code
easier as it will follow the normal standards for kernel driver model
interaction?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Samuel Ortiz
Hi Arnd,

On Mon, Feb 11, 2013 at 02:58:37PM +, Arnd Bergmann wrote:
> On Thursday 07 February 2013, Samuel Ortiz wrote:
> > 
> > On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
> > > On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
> > > > On Thursday 07 February 2013, Tomas Winkler wrote:
> > > > > 
> > > > > +inline void *mei_bus_get_clientdata(const struct mei_bus_client 
> > > > > *client)
> > > > > +{
> > > > > +   return dev_get_drvdata(>dev);
> > > > > +}
> > > > > +EXPORT_SYMBOL(mei_bus_get_clientdata);
> > > > > +
> > > > 
> > > > Did you really mean to export an inline function?
> > > > 
> > > > Can you make this a static inline function in a header file instead?
> > > Sure, will do.
> > Actually, I'd like to keep the mei_bus_client structure opaque to the MEI 
> > bus
> > drivers. So I'll still export those symbols without inlining them.
> 
> Ok, makes sense. I assume when you say "bus driver" you mean what other
> subsystems call a "device driver".
That's correct, yes.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Arnd Bergmann
On Thursday 07 February 2013, Samuel Ortiz wrote:
> 
> On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
> > On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
> > > On Thursday 07 February 2013, Tomas Winkler wrote:
> > > > 
> > > > +inline void *mei_bus_get_clientdata(const struct mei_bus_client 
> > > > *client)
> > > > +{
> > > > +   return dev_get_drvdata(>dev);
> > > > +}
> > > > +EXPORT_SYMBOL(mei_bus_get_clientdata);
> > > > +
> > > 
> > > Did you really mean to export an inline function?
> > > 
> > > Can you make this a static inline function in a header file instead?
> > Sure, will do.
> Actually, I'd like to keep the mei_bus_client structure opaque to the MEI bus
> drivers. So I'll still export those symbols without inlining them.

Ok, makes sense. I assume when you say "bus driver" you mean what other
subsystems call a "device driver".

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Arnd Bergmann
On Thursday 07 February 2013, Samuel Ortiz wrote:
 
 On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
  On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
   On Thursday 07 February 2013, Tomas Winkler wrote:

+inline void *mei_bus_get_clientdata(const struct mei_bus_client 
*client)
+{
+   return dev_get_drvdata(client-dev);
+}
+EXPORT_SYMBOL(mei_bus_get_clientdata);
+
   
   Did you really mean to export an inline function?
   
   Can you make this a static inline function in a header file instead?
  Sure, will do.
 Actually, I'd like to keep the mei_bus_client structure opaque to the MEI bus
 drivers. So I'll still export those symbols without inlining them.

Ok, makes sense. I assume when you say bus driver you mean what other
subsystems call a device driver.

Arnd
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Samuel Ortiz
Hi Arnd,

On Mon, Feb 11, 2013 at 02:58:37PM +, Arnd Bergmann wrote:
 On Thursday 07 February 2013, Samuel Ortiz wrote:
  
  On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
   On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
On Thursday 07 February 2013, Tomas Winkler wrote:
 
 +inline void *mei_bus_get_clientdata(const struct mei_bus_client 
 *client)
 +{
 +   return dev_get_drvdata(client-dev);
 +}
 +EXPORT_SYMBOL(mei_bus_get_clientdata);
 +

Did you really mean to export an inline function?

Can you make this a static inline function in a header file instead?
   Sure, will do.
  Actually, I'd like to keep the mei_bus_client structure opaque to the MEI 
  bus
  drivers. So I'll still export those symbols without inlining them.
 
 Ok, makes sense. I assume when you say bus driver you mean what other
 subsystems call a device driver.
That's correct, yes.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Greg KH
On Mon, Feb 11, 2013 at 04:29:29PM +0100, Samuel Ortiz wrote:
 Hi Arnd,
 
 On Mon, Feb 11, 2013 at 02:58:37PM +, Arnd Bergmann wrote:
  On Thursday 07 February 2013, Samuel Ortiz wrote:
   
   On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
 On Thursday 07 February 2013, Tomas Winkler wrote:
  
  +inline void *mei_bus_get_clientdata(const struct mei_bus_client 
  *client)
  +{
  +   return dev_get_drvdata(client-dev);
  +}
  +EXPORT_SYMBOL(mei_bus_get_clientdata);
  +
 
 Did you really mean to export an inline function?
 
 Can you make this a static inline function in a header file instead?
Sure, will do.
   Actually, I'd like to keep the mei_bus_client structure opaque to the MEI 
   bus
   drivers. So I'll still export those symbols without inlining them.
  
  Ok, makes sense. I assume when you say bus driver you mean what other
  subsystems call a device driver.
 That's correct, yes.

Thanks for clearing that up.  So, in your next revision, can you use the
proper names for everything so that we all can understand the code
easier as it will follow the normal standards for kernel driver model
interaction?

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-11 Thread Samuel Ortiz
On Mon, Feb 11, 2013 at 08:03:46AM -0800, Greg KH wrote:
 On Mon, Feb 11, 2013 at 04:29:29PM +0100, Samuel Ortiz wrote:
  Hi Arnd,
  
  On Mon, Feb 11, 2013 at 02:58:37PM +, Arnd Bergmann wrote:
   On Thursday 07 February 2013, Samuel Ortiz wrote:

On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
 On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
  On Thursday 07 February 2013, Tomas Winkler wrote:
   
   +inline void *mei_bus_get_clientdata(const struct mei_bus_client 
   *client)
   +{
   +   return dev_get_drvdata(client-dev);
   +}
   +EXPORT_SYMBOL(mei_bus_get_clientdata);
   +
  
  Did you really mean to export an inline function?
  
  Can you make this a static inline function in a header file instead?
 Sure, will do.
Actually, I'd like to keep the mei_bus_client structure opaque to the 
MEI bus
drivers. So I'll still export those symbols without inlining them.
   
   Ok, makes sense. I assume when you say bus driver you mean what other
   subsystems call a device driver.
  That's correct, yes.
 
 Thanks for clearing that up.  So, in your next revision, can you use the
 proper names for everything so that we all can understand the code
 easier as it will follow the normal standards for kernel driver model
 interaction?
I will certainly do that, yes.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Samuel Ortiz
On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
> On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
> > On Thursday 07 February 2013, Tomas Winkler wrote:
> > > 
> > > +inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
> > > +{
> > > +   return dev_get_drvdata(>dev);
> > > +}
> > > +EXPORT_SYMBOL(mei_bus_get_clientdata);
> > > +
> > 
> > Did you really mean to export an inline function?
> > 
> > Can you make this a static inline function in a header file instead?
> Sure, will do.
Actually, I'd like to keep the mei_bus_client structure opaque to the MEI bus
drivers. So I'll still export those symbols without inlining them.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Samuel Ortiz
On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
> On Thursday 07 February 2013, Tomas Winkler wrote:
> > 
> > +inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
> > +{
> > +   return dev_get_drvdata(>dev);
> > +}
> > +EXPORT_SYMBOL(mei_bus_get_clientdata);
> > +
> 
> Did you really mean to export an inline function?
> 
> Can you make this a static inline function in a header file instead?
Sure, will do.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Arnd Bergmann
On Thursday 07 February 2013, Tomas Winkler wrote:
> 
> +inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
> +{
> +   return dev_get_drvdata(>dev);
> +}
> +EXPORT_SYMBOL(mei_bus_get_clientdata);
> +

Did you really mean to export an inline function?

Can you make this a static inline function in a header file instead?

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Tomas Winkler
From: Samuel Ortiz 

MEI bus drivers should be able to carry their private data around.

Signed-off-by: Samuel Ortiz 
Signed-off-by: Tomas Winkler 
---
 drivers/misc/mei/bus.c  |   12 
 include/linux/mei_bus.h |3 +++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 3f10d51..58032cf 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -448,6 +448,18 @@ int mei_bus_register_event_cb(struct mei_bus_client 
*client,
 }
 EXPORT_SYMBOL(mei_bus_register_event_cb);
 
+inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
+{
+   return dev_get_drvdata(>dev);
+}
+EXPORT_SYMBOL(mei_bus_get_clientdata);
+
+inline void mei_bus_set_clientdata(struct mei_bus_client *client, void *data)
+{
+   dev_set_drvdata(>dev, data);
+}
+EXPORT_SYMBOL(mei_bus_set_clientdata);
+
 void mei_bus_rx_event(struct mei_cl *cl)
 {
struct mei_bus_client *client = cl->client;
diff --git a/include/linux/mei_bus.h b/include/linux/mei_bus.h
index 241325f..0e8e4e9 100644
--- a/include/linux/mei_bus.h
+++ b/include/linux/mei_bus.h
@@ -102,4 +102,7 @@ typedef void (*mei_bus_event_cb_t)(struct mei_bus_client 
*client,
 int mei_bus_register_event_cb(struct mei_bus_client *client,
  mei_bus_event_cb_t read_cb, void *context);
 
+void *mei_bus_get_clientdata(const struct mei_bus_client *client);
+void mei_bus_set_clientdata(struct mei_bus_client *client, void *data);
+
 #endif /* _LINUX_MEI_BUS_H */
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Tomas Winkler
From: Samuel Ortiz sa...@linux.intel.com

MEI bus drivers should be able to carry their private data around.

Signed-off-by: Samuel Ortiz sa...@linux.intel.com
Signed-off-by: Tomas Winkler tomas.wink...@intel.com
---
 drivers/misc/mei/bus.c  |   12 
 include/linux/mei_bus.h |3 +++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 3f10d51..58032cf 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -448,6 +448,18 @@ int mei_bus_register_event_cb(struct mei_bus_client 
*client,
 }
 EXPORT_SYMBOL(mei_bus_register_event_cb);
 
+inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
+{
+   return dev_get_drvdata(client-dev);
+}
+EXPORT_SYMBOL(mei_bus_get_clientdata);
+
+inline void mei_bus_set_clientdata(struct mei_bus_client *client, void *data)
+{
+   dev_set_drvdata(client-dev, data);
+}
+EXPORT_SYMBOL(mei_bus_set_clientdata);
+
 void mei_bus_rx_event(struct mei_cl *cl)
 {
struct mei_bus_client *client = cl-client;
diff --git a/include/linux/mei_bus.h b/include/linux/mei_bus.h
index 241325f..0e8e4e9 100644
--- a/include/linux/mei_bus.h
+++ b/include/linux/mei_bus.h
@@ -102,4 +102,7 @@ typedef void (*mei_bus_event_cb_t)(struct mei_bus_client 
*client,
 int mei_bus_register_event_cb(struct mei_bus_client *client,
  mei_bus_event_cb_t read_cb, void *context);
 
+void *mei_bus_get_clientdata(const struct mei_bus_client *client);
+void mei_bus_set_clientdata(struct mei_bus_client *client, void *data);
+
 #endif /* _LINUX_MEI_BUS_H */
-- 
1.7.4.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Arnd Bergmann
On Thursday 07 February 2013, Tomas Winkler wrote:
 
 +inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
 +{
 +   return dev_get_drvdata(client-dev);
 +}
 +EXPORT_SYMBOL(mei_bus_get_clientdata);
 +

Did you really mean to export an inline function?

Can you make this a static inline function in a header file instead?

Arnd
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Samuel Ortiz
On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
 On Thursday 07 February 2013, Tomas Winkler wrote:
  
  +inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
  +{
  +   return dev_get_drvdata(client-dev);
  +}
  +EXPORT_SYMBOL(mei_bus_get_clientdata);
  +
 
 Did you really mean to export an inline function?
 
 Can you make this a static inline function in a header file instead?
Sure, will do.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [char-misc-next 07/11] mei: bus: Implement bus driver data setter/getter

2013-02-07 Thread Samuel Ortiz
On Thu, Feb 07, 2013 at 11:58:09PM +0100, Samuel Ortiz wrote:
 On Thu, Feb 07, 2013 at 10:38:44PM +, Arnd Bergmann wrote:
  On Thursday 07 February 2013, Tomas Winkler wrote:
   
   +inline void *mei_bus_get_clientdata(const struct mei_bus_client *client)
   +{
   +   return dev_get_drvdata(client-dev);
   +}
   +EXPORT_SYMBOL(mei_bus_get_clientdata);
   +
  
  Did you really mean to export an inline function?
  
  Can you make this a static inline function in a header file instead?
 Sure, will do.
Actually, I'd like to keep the mei_bus_client structure opaque to the MEI bus
drivers. So I'll still export those symbols without inlining them.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/