LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 00/14] [ISDN] HiSax hotplug conversion
@ 2007-07-18  3:04 Jeff Garzik
  2007-07-18  3:04 ` [PATCH 01/14] [ISDN] HiSax: modularize card setup Jeff Garzik
                   ` (17 more replies)
  0 siblings, 18 replies; 28+ messages in thread
From: Jeff Garzik @ 2007-07-18  3:04 UTC (permalink / raw)
  To: linux-kernel, kkeil, isdn4linux; +Cc: Greg KH


This is a refresh of an on-going work-in-progress:  convert the last
remaining users of pci_find_device() to the ISA/PCI/etc.  hotplug APIs
now in standard use.  After SCSI's gdth, ISDN's HiSax suite of drivers
are just about the last place using the older API.

A few rough edges remain, and I'm not sure how much of ISDN userland
will explode (I have no ISDN hardware, nor much want any:)), but this
should get us almost all the way there.

The patches are diff'd against 2.6.25-rc1.

Comments/review/testing welcome.  Especially "it works" or "its dead"
testing.


^ permalink raw reply	[flat|nested] 28+ messages in thread
* [PATCH 01/14] [ISDN] HiSax: modularization prep
@ 2008-02-16  4:41 Jeff Garzik
  2007-10-31  5:10 ` [PATCH 03/14] [ISDN] Ready HiSax driver for modularization Jeff Garzik
  0 siblings, 1 reply; 28+ messages in thread
From: Jeff Garzik @ 2008-02-16  4:41 UTC (permalink / raw)
  To: kkeil, isdn4linux, linux-kernel

Pass a function pointer into the core HiSax probe function checkcard(),
in order to facilitate modular drivers passing in their own setup
routines.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
 drivers/isdn/hisax/config.c    |   14 +++++++++-----
 drivers/isdn/hisax/hisax_cfg.h |    2 ++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index a0ee43c..84d75a3 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1169,7 +1169,9 @@ outf_cs:
 /* Used from an exported function but calls __devinit functions.
  * Tell modpost not to warn (__ref)
  */
-static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
+static int __ref checkcard(int cardnr, char *id, int *busy_flag,
+			   struct module *lockowner,
+			   hisax_setup_func_t card_setup)
 {
 	int ret;
 	struct IsdnCard *card = cards + cardnr;
@@ -1187,7 +1189,7 @@ static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *
 	       (card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
 	       "NONE", cs->iif.id, cs->myid);
 
-	ret = hisax_cs_setup_card(card);
+	ret = card_setup(card);
 	if (!ret) {
 		ll_unload(cs);
 		goto outf_cs;
@@ -1241,7 +1243,8 @@ static int HiSax_inithardware(int *busy_flag)
 			else
 				sprintf(ids, "%s%d", id, i);
 		}
-		if (checkcard(i, ids, busy_flag, THIS_MODULE)) {
+		if (checkcard(i, ids, busy_flag, THIS_MODULE,
+			      hisax_cs_setup_card)) {
 			foundcards++;
 			i++;
 		} else {
@@ -1549,7 +1552,8 @@ int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
 		sprintf(ids, "HiSax%d", nrcards);
 	else
 		sprintf(ids, "HiSax");
-	if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE))
+	if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE,
+		       hisax_cs_setup_card))
 		goto error;
 
 	ret = nrcards;
@@ -1595,7 +1599,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
 	cards[i].protocol = protocol;
 	sprintf(id, "%s%d", name, i);
 	nrcards++;
-	retval = checkcard(i, id, NULL, hisax_d_if->owner);
+	retval = checkcard(i, id, NULL, hisax_d_if->owner, hisax_cs_setup_card);
 	if (retval == 0) { // yuck
 		cards[i].typ = 0;
 		nrcards--;
diff --git a/drivers/isdn/hisax/hisax_cfg.h b/drivers/isdn/hisax/hisax_cfg.h
index ca3fe62..17a2fea 100644
--- a/drivers/isdn/hisax/hisax_cfg.h
+++ b/drivers/isdn/hisax/hisax_cfg.h
@@ -60,5 +60,7 @@ struct IsdnCard {
 	IsdnCardState_t	*cs;
 };
 
+typedef int (*hisax_setup_func_t)(struct IsdnCard *card);
+
 extern void	HiSax_closecard(int);
 extern int	hisax_init_pcmcia(void *, int *, IsdnCard_t *);
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2008-02-16 20:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18  3:04 [PATCH 00/14] [ISDN] HiSax hotplug conversion Jeff Garzik
2007-07-18  3:04 ` [PATCH 01/14] [ISDN] HiSax: modularize card setup Jeff Garzik
2008-02-15 13:38   ` Sam Ravnborg
2007-07-18  3:46 ` [PATCH 04/14] [ISDN] HiSax bkm_a4t: convert to PCI hotplug API Jeff Garzik
2008-02-15 13:33   ` Sam Ravnborg
2007-07-18  3:49 ` [PATCH 05/14] [ISDN] HiSax enternow: " Jeff Garzik
2008-02-15 13:21   ` Jan Engelhardt
2007-07-18  3:54 ` [PATCH 06/14] [ISDN] HiSax hfc_pci, w6692: " Jeff Garzik
2007-07-18  3:59 ` [PATCH 07/14] [ISDN] HiSax nj_s, nj_u: " Jeff Garzik
2007-07-18  4:02 ` [PATCH 08/14] [ISDN] HiSax telespci: " Jeff Garzik
2007-07-24 12:26 ` [PATCH 11/14] [ISDN] HiSax niccy: convert to modern ISA/PNP/PCI probing Jeff Garzik
2007-08-02 12:37 ` [PATCH 13/14] [ISDN] HiSax bkm_a8: convert to PCI hotplug API Jeff Garzik
2007-10-31  5:10 ` [PATCH 03/14] [ISDN] Ready HiSax driver for modularization Jeff Garzik
2008-02-15 13:45   ` Sam Ravnborg
2007-10-31  5:11 ` [PATCH 09/14] [ISDN] HiSax avm_pci: convert to modern PCI/ISA/PNP probing Jeff Garzik
2007-10-31  5:12 ` [PATCH 10/14] [ISDN] HiSax gazel: convert to modern ISA/PCI probing Jeff Garzik
2007-10-31  5:13 ` [PATCH 12/14] [ISDN] HiSax diva: convert to modern ISA/PNP/PCI probing Jeff Garzik
2007-10-31  7:42 ` [PATCH 02/14] [ISDN] Hisax: eliminate many unnecessary references to CardType[] Jeff Garzik
2008-02-15 13:37   ` Sam Ravnborg
2007-11-06 14:41 ` [PATCH 14/14] [isdn-pci] add missing file Jeff Garzik
2008-02-14 23:52 ` [PATCH 00/14] [ISDN] HiSax hotplug conversion Greg KH
2008-02-14 23:50   ` Jeff Garzik
2008-02-14 23:53 ` Jeff Garzik
2008-02-15 13:27 ` Sam Ravnborg
2008-02-15 15:13   ` Jeff Garzik
2008-02-15 19:11     ` Sam Ravnborg
2008-02-16  1:09 ` Andrew Morton
2008-02-16  4:41 [PATCH 01/14] [ISDN] HiSax: modularization prep Jeff Garzik
2007-10-31  5:10 ` [PATCH 03/14] [ISDN] Ready HiSax driver for modularization Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).