Re: [PATCH] drivers:staging:ti-st: remove st_get_plat_device

Previous thread: [PATCH] m68k,m68knommu: Wire up fanotify_init, fanotify_mark, and prlimit64 by Geert Uytterhoeven on Thursday, August 19, 2010 - 9:05 am. (2 messages)

Next thread: [PATCH 1/2] kernel.h: add {min,max}3 macros by Hagen Paul Pfeifer on Thursday, August 19, 2010 - 10:18 am. (2 messages)
From: pavan_savoy
Date: Thursday, August 19, 2010 - 11:08 am

From: Pavan Savoy <pavan_savoy@ti.com>

In order to support multiple ST platform devices, a new symbol
'st_get_plat_device' earlier needed to be exported by the arch/XX/brd-XX.c
file which intends to add the ST platform device.

On removing this dependency, now inside ST driver maintain the array of
ST platform devices that would be registered.
As of now let id=0, as and when we end up having such platforms
where mutliple ST devices can exist, id would come from
protocol drivers (BT, FM and GPS) as to on which platform device
they want to register to.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/staging/ti-st/st.h      |    1 -
 drivers/staging/ti-st/st_core.c |    9 ++++-----
 drivers/staging/ti-st/st_core.h |    2 +-
 drivers/staging/ti-st/st_kim.c  |   22 +++++++++++++++++++---
 4 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/ti-st/st.h b/drivers/staging/ti-st/st.h
index 9952579..1b3060e 100644
--- a/drivers/staging/ti-st/st.h
+++ b/drivers/staging/ti-st/st.h
@@ -80,5 +80,4 @@ struct st_proto_s {
 extern long st_register(struct st_proto_s *);
 extern long st_unregister(enum proto_type);
 
-extern struct platform_device *st_get_plat_device(void);
 #endif /* ST_H */
diff --git a/drivers/staging/ti-st/st_core.c b/drivers/staging/ti-st/st_core.c
index 063c9b1..b85d8bf 100644
--- a/drivers/staging/ti-st/st_core.c
+++ b/drivers/staging/ti-st/st_core.c
@@ -38,7 +38,6 @@
 #include "st_ll.h"
 #include "st.h"
 
-#define VERBOSE
 /* strings to be used for rfkill entries and by
  * ST Core to be used for sysfs debug entry
  */
@@ -581,7 +580,7 @@ long st_register(struct st_proto_s *new_proto)
 	long err = 0;
 	unsigned long flags = 0;
 
-	st_kim_ref(&st_gdata);
+	st_kim_ref(&st_gdata, 0);
 	pr_info("%s(%d) ", __func__, new_proto->type);
 	if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL
 	    || new_proto->reg_complete_cb == NULL) {
@@ -713,7 +712,7 @@ long st_unregister(enum proto_type type)
 
 ...
From: Randy Dunlap
Date: Thursday, August 19, 2010 - 10:32 am

Thanks, that builds cleanly.  I'm OK with it if you are comfortable with a
hard limit on the fixed number of devices that can be supported:

+#define MAX_ST_DEVICES	3	/* Imagine 1 on each UART for now */
+struct platform_device *st_kim_devices[MAX_ST_DEVICES];

We usually try not to have such limits nor use arrays like that,
but if the nature of the device and its platform/environment is like


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--

From: Savoy, Pavan
Date: Thursday, August 19, 2010 - 10:35 am

Actually on all platforms that I have seen there's only 1 such device.
The device is basically a connectivity chip (with Bluetooth, FM and GPS working
on a single UART)

The number which I mentioned was out of imagination.
--

From: Randy Dunlap
Date: Thursday, August 19, 2010 - 10:37 am

OK, thanks.



-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--

From: Greg KH
Date: Saturday, August 21, 2010 - 8:32 pm

Yes, I will work on it, sorry, been swamped with other work lately.

Don't worry, this patch is in my "to-apply" queue.

thanks,

greg k-h
--

From: Savoy, Pavan
Date: Monday, August 30, 2010 - 3:09 pm

Any update on this?
--

From: Greg KH
Date: Monday, August 30, 2010 - 9:11 pm

Nope, sorry.  I got sick and combined with vacation requirements from
the family, and my "real job" and other things lately, I hope to get to
it by the end of this week.  If not, kick me, I'll have time on a
trans-continent flight next week that should give me plenty of time to
do this...

thanks,

greg k-h
--

From: Savoy, Pavan
Date: Tuesday, August 31, 2010 - 3:23 pm

Gzee Thanks, so since you added the patch now, I guess you will be reviewing
--

From: Greg KH
Date: Tuesday, August 31, 2010 - 3:42 pm

Yes, I will try to do that.

thanks,

greg k-h
--

From: Savoy, Pavan
Date: Tuesday, September 7, 2010 - 2:08 pm

From: Anca Emanuel
Date: Tuesday, September 7, 2010 - 11:27 pm

Build error (kernel 2.6.36-rc3-git1):


Building modules, stage 2.
  MODPOST 3056 modules
ERROR: "st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!
--

From: Savoy, Pavan
Date: Wednesday, September 8, 2010 - 7:39 am

Emanuel,

I've recently posted a patch to solve this problem.
Patch @ http://lkml.org/lkml/2010/8/19/238
 
PS: In fact it is strange that you replied to the same thread which is supposed to solve the problem.

--

From: Anca Emanuel
Date: Wednesday, September 8, 2010 - 12:03 pm

Linus, this patch is not in your tree.

please fix this.

--

From: Savoy, Pavan
Date: Wednesday, September 8, 2010 - 12:05 pm

I don't think it needs to be for now.
It will get merged upon next update from linux-next.

--

From: Anca Emanuel
Date: Tuesday, September 21, 2010 - 10:34 am

> It is currently in linux-next.

Greg,

you send some pull requests to Linus.
Can you compile the kernel without this patch ?

see here:
http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.36-rc5-maverick/0002-DISABLE-ti-st....

I know you are overburned. Just get 1 or 2 guys to teach them to help you.
--

From: Greg KH
Date: Tuesday, September 21, 2010 - 10:37 am

I still don't understand, what does that patch have to do with the
staging tree?

thanks,

greg k-h
--

From: Anca Emanuel
Date: Tuesday, September 21, 2010 - 11:06 am

In Ubuntu, the ti-st driver have a problem at the building time.
--

From: Greg KH
Date: Tuesday, September 21, 2010 - 11:12 am

Ok, then in Ubuntu, don't enable it in the configuration file, no need
to comment out the whole directory :)

Is there a specific patch that fixes this issue that is not around?  Or
is it already in my staging-next tree and you feel it should be added to
the final .36 release?

If so, which one is it?

thanks,

greg k-h
--

From: Savoy, Pavan
Date: Tuesday, September 21, 2010 - 11:18 am

This patch on the ti-st/ inside staging/ fixes the problem.
It has made it to the linux-next,
--

From: Greg KH
Date: Tuesday, September 21, 2010 - 1:06 pm

I'll add it to the queue to go to Linus earlier if I get the chance.  If
not, it's not a big deal we can add it to the .36-stable tree.

thanks,

greg k-h
--

From: Anca Emanuel
Date: Tuesday, September 21, 2010 - 11:23 am

for the build problem, include it in 2.6.36
no need for more delay.
--

Previous thread: [PATCH] m68k,m68knommu: Wire up fanotify_init, fanotify_mark, and prlimit64 by Geert Uytterhoeven on Thursday, August 19, 2010 - 9:05 am. (2 messages)

Next thread: [PATCH 1/2] kernel.h: add {min,max}3 macros by Hagen Paul Pfeifer on Thursday, August 19, 2010 - 10:18 am. (2 messages)