Commit 17fa6e2f authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] sk98lin: routine called from probe marked __init

Sk98lin driver has a routine marked __init that is called from
the probe code. If using pci hotplug, this could be called after
the initialization so it needs to be marked __devinit.
So if you hot added a sk98lin board, the kernel would crash.
I don't have hot plug hardware to actually try this feat.

Also, there are two routines, only called from SkGeBoardInit that can
be marked __devinit.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 5367f2d6
...@@ -282,10 +282,11 @@ SK_U32 Val) /* pointer to store the read value */ ...@@ -282,10 +282,11 @@ SK_U32 Val) /* pointer to store the read value */
* Description: * Description:
* This function initialize the PCI resources and IO * This function initialize the PCI resources and IO
* *
* Returns: N/A * Returns:
* * 0 - indicate everything worked ok.
* != 0 - error indication
*/ */
int SkGeInitPCI(SK_AC *pAC) static __devinit int SkGeInitPCI(SK_AC *pAC)
{ {
struct SK_NET_DEVICE *dev = pAC->dev[0]; struct SK_NET_DEVICE *dev = pAC->dev[0];
struct pci_dev *pdev = pAC->PciDev; struct pci_dev *pdev = pAC->PciDev;
...@@ -492,7 +493,7 @@ module_param_array(AutoSizing, charp, NULL, 0); ...@@ -492,7 +493,7 @@ module_param_array(AutoSizing, charp, NULL, 0);
* 0, if everything is ok * 0, if everything is ok
* !=0, on error * !=0, on error
*/ */
static int __init SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC) static int __devinit SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC)
{ {
short i; short i;
unsigned long Flags; unsigned long Flags;
...@@ -633,8 +634,7 @@ SK_BOOL DualNet; ...@@ -633,8 +634,7 @@ SK_BOOL DualNet;
* SK_TRUE, if all memory could be allocated * SK_TRUE, if all memory could be allocated
* SK_FALSE, if not * SK_FALSE, if not
*/ */
static SK_BOOL BoardAllocMem( static __devinit SK_BOOL BoardAllocMem(SK_AC *pAC)
SK_AC *pAC)
{ {
caddr_t pDescrMem; /* pointer to descriptor memory area */ caddr_t pDescrMem; /* pointer to descriptor memory area */
size_t AllocLength; /* length of complete descriptor area */ size_t AllocLength; /* length of complete descriptor area */
...@@ -727,8 +727,7 @@ size_t AllocLength; /* length of complete descriptor area */ ...@@ -727,8 +727,7 @@ size_t AllocLength; /* length of complete descriptor area */
* *
* Returns: N/A * Returns: N/A
*/ */
static void BoardInitMem( static __devinit void BoardInitMem(SK_AC *pAC)
SK_AC *pAC) /* pointer to adapter context */
{ {
int i; /* loop counter */ int i; /* loop counter */
int RxDescrSize; /* the size of a rx descriptor rounded up to alignment*/ int RxDescrSize; /* the size of a rx descriptor rounded up to alignment*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment