lkml.org 
[lkml]   [2000]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] __init fixes in IDE
Date
Hi,
I noticed that in some IDE drivers init functions are marked __init
and in some others (mainly: old drivers and non-x86 architectures) they
are not. The following patch should fix this situation in most IDE
code...

Andre, are theese functions intentionally *not marked* __init ?
Does Amiga/Mac support __init ?

Regards
Andrzej

*************************************************************************
diff -u --recursive 2.3.44/drivers/block/ali14xx.c linux/drivers/block/ali14xx.c
--- 2.3.44/drivers/block/ali14xx.c Fri Nov 12 19:12:11 1999
+++ linux/drivers/block/ali14xx.c Sun Feb 13 00:40:29 2000
@@ -55,12 +55,12 @@

/* port addresses for auto-detection */
#define ALI_NUM_PORTS 4
-static int ports[ALI_NUM_PORTS] = {0x074, 0x0f4, 0x034, 0x0e4};
+static int __init ports[ALI_NUM_PORTS] = {0x074, 0x0f4, 0x034, 0x0e4};

/* register initialization data */
typedef struct { byte reg, data; } RegInitializer;

-static RegInitializer initData[] = {
+static RegInitializer __init initData[] = {
{0x01, 0x0f}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00},
{0x05, 0x00}, {0x06, 0x00}, {0x07, 0x2b}, {0x0a, 0x0f},
{0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00},
@@ -150,7 +150,7 @@
/*
* Auto-detect the IDE controller port.
*/
-static int findPort (void)
+static int __init findPort (void)
{
int i;
byte t;
@@ -183,7 +183,7 @@
/*
* Initialize controller registers with default values.
*/
-static int initRegisters (void) {
+static int __init initRegisters (void) {
RegInitializer *p;
byte t;
unsigned long flags;
@@ -200,7 +200,7 @@
return t;
}

-void init_ali14xx (void)
+void __init init_ali14xx (void)
{
/* auto-detect IDE controller port */
if (!findPort()) {
diff -u --recursive 2.3.44/drivers/block/buddha.c linux/drivers/block/buddha.c
--- 2.3.44/drivers/block/buddha.c Wed Jan 26 21:45:20 2000
+++ linux/drivers/block/buddha.c Sun Feb 13 01:58:01 2000
@@ -42,7 +42,7 @@
#define BUDDHA_BASE2 0xa00
#define BUDDHA_BASE3 0xc00

-static const u_int buddha_bases[CATWEASEL_NUM_HWIFS] = {
+static const u_int __init buddha_bases[CATWEASEL_NUM_HWIFS] = {
BUDDHA_BASE1, BUDDHA_BASE2, BUDDHA_BASE3
};

@@ -61,7 +61,7 @@
#define BUDDHA_STATUS 0x1e /* see status-bits */
#define BUDDHA_CONTROL 0x11a

-static int buddha_offsets[IDE_NR_PORTS] = {
+static int __init buddha_offsets[IDE_NR_PORTS] = {
BUDDHA_DATA, BUDDHA_ERROR, BUDDHA_NSECTOR, BUDDHA_SECTOR, BUDDHA_LCYL,
BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, BUDDHA_CONTROL
};
@@ -75,7 +75,7 @@
#define BUDDHA_IRQ2 0xf40 /* interrupt */
#define BUDDHA_IRQ3 0xf80

-static const int buddha_irqports[CATWEASEL_NUM_HWIFS] = {
+static const int __init buddha_irqports[CATWEASEL_NUM_HWIFS] = {
BUDDHA_IRQ1, BUDDHA_IRQ2, BUDDHA_IRQ3
};

@@ -109,7 +109,7 @@
* Any Buddha or Catweasel boards present?
*/

-static int find_buddha(void)
+static int __init find_buddha(void)
{
struct zorro_dev *z = NULL;

@@ -143,7 +143,7 @@
* We support only _one_ of them, no multiple boards!
*/

-void buddha_init(void)
+void __init buddha_init(void)
{
hw_regs_t hw;
int i, index;
diff -u --recursive 2.3.44/drivers/block/cmd640.c linux/drivers/block/cmd640.c
--- 2.3.44/drivers/block/cmd640.c Fri Nov 12 19:12:11 1999
+++ linux/drivers/block/cmd640.c Sun Feb 13 02:31:58 2000
@@ -290,7 +290,7 @@
return b;
}

-static int match_pci_cmd640_device (void)
+static int __init match_pci_cmd640_device (void)
{
const byte ven_dev[4] = {0x95, 0x10, 0x40, 0x06};
unsigned int i;
@@ -310,7 +310,7 @@
/*
* Probe for CMD640x -- pci method 1
*/
-static int probe_for_cmd640_pci1 (void)
+static int __init probe_for_cmd640_pci1 (void)
{
get_cmd640_reg = get_cmd640_reg_pci1;
put_cmd640_reg = put_cmd640_reg_pci1;
@@ -324,7 +324,7 @@
/*
* Probe for CMD640x -- pci method 2
*/
-static int probe_for_cmd640_pci2 (void)
+static int __init probe_for_cmd640_pci2 (void)
{
get_cmd640_reg = get_cmd640_reg_pci2;
put_cmd640_reg = put_cmd640_reg_pci2;
@@ -338,7 +338,7 @@
/*
* Probe for CMD640x -- vlb
*/
-static int probe_for_cmd640_vlb (void)
+static int __init probe_for_cmd640_vlb (void)
{
byte b;

@@ -359,7 +359,7 @@
* Returns 1 if an IDE interface/drive exists at 0x170,
* Returns 0 otherwise.
*/
-static int secondary_port_responding (void)
+static int __init secondary_port_responding (void)
{
unsigned long flags;

@@ -403,7 +403,7 @@
* Check whether prefetch is on for a drive,
* and initialize the unmask flags for safe operation.
*/
-static void check_prefetch (unsigned int index)
+static void __init check_prefetch (unsigned int index)
{
ide_drive_t *drive = cmd_drives[index];
byte b = get_cmd640_reg(prefetch_regs[index]);
@@ -424,7 +424,7 @@
/*
* Figure out which devices we control
*/
-static void setup_device_ptrs (void)
+static void __init setup_device_ptrs (void)
{
unsigned int i;

@@ -507,7 +507,7 @@
/*
* This routine retrieves the initial drive timings from the chipset.
*/
-static void retrieve_drive_counts (unsigned int index)
+static void __init retrieve_drive_counts (unsigned int index)
{
byte b;

@@ -694,7 +694,7 @@
/*
* Probe for a cmd640 chipset, and initialize it if found. Called from ide.c
*/
-int ide_probe_for_cmd640x (void)
+int __init ide_probe_for_cmd640x (void)
{
#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
int second_port_toggled = 0;
diff -u --recursive 2.3.44/drivers/block/dtc2278.c linux/drivers/block/dtc2278.c
--- 2.3.44/drivers/block/dtc2278.c Thu May 13 20:04:54 1999
+++ linux/drivers/block/dtc2278.c Sun Feb 13 00:48:58 2000
@@ -95,7 +95,7 @@
HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
}

-void init_dtc2278 (void)
+void __init init_dtc2278 (void)
{
unsigned long flags;

diff -u --recursive 2.3.44/drivers/block/falconide.c linux/drivers/block/falconide.c
--- 2.3.44/drivers/block/falconide.c Thu May 13 20:04:54 1999
+++ linux/drivers/block/falconide.c Sun Feb 13 01:52:38 2000
@@ -40,7 +40,7 @@
#define ATA_HD_STATUS 0x1d /* see status-bits */
#define ATA_HD_CONTROL 0x39

-static int falconide_offsets[IDE_NR_PORTS] = {
+static int __init falconide_offsets[IDE_NR_PORTS] = {
ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL,
ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1
};
@@ -50,7 +50,7 @@
* Probe for a Falcon IDE interface
*/

-void falconide_init(void)
+void __init falconide_init(void)
{
if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
hw_regs_t hw;
diff -u --recursive 2.3.44/drivers/block/gayle.c linux/drivers/block/gayle.c
--- 2.3.44/drivers/block/gayle.c Thu May 13 20:04:54 1999
+++ linux/drivers/block/gayle.c Sun Feb 13 01:51:19 2000
@@ -41,7 +41,7 @@
#define GAYLE_STATUS 0x1e /* see status-bits */
#define GAYLE_CONTROL 0x101a

-static int gayle_offsets[IDE_NR_PORTS] = {
+static int __init gayle_offsets[IDE_NR_PORTS] = {
GAYLE_DATA, GAYLE_ERROR, GAYLE_NSECTOR, GAYLE_SECTOR, GAYLE_LCYL,
GAYLE_HCYL, GAYLE_SELECT, GAYLE_STATUS, -1, -1
};
@@ -105,7 +105,7 @@
* Probe for a Gayle IDE interface (and optionally for an IDE doubler)
*/

-void gayle_init(void)
+void __init gayle_init(void)
{
int a4000, i;

diff -u --recursive 2.3.44/drivers/block/ht6560b.c linux/drivers/block/ht6560b.c
--- 2.3.44/drivers/block/ht6560b.c Thu May 13 20:04:54 1999
+++ linux/drivers/block/ht6560b.c Sun Feb 13 00:52:47 2000
@@ -162,7 +162,7 @@
/*
* Autodetection and initialization of ht6560b
*/
-int try_to_init_ht6560b(void)
+static int __init try_to_init_ht6560b(void)
{
byte orig_value;
int i;
@@ -213,7 +213,7 @@
ht6560b_selects[hwif][unit] &= ~0x20;
}

-void init_ht6560b (void)
+void __init init_ht6560b (void)
{
if (check_region(HT_SELECT_PORT,1)) {
printk("\nht6560b: PORT 0x3e6 ALREADY IN USE\n");
diff -u --recursive 2.3.44/drivers/block/icside.c linux/drivers/block/icside.c
--- 2.3.44/drivers/block/icside.c Thu Jan 27 17:58:15 2000
+++ linux/drivers/block/icside.c Sun Feb 13 01:37:25 2000
@@ -53,25 +53,25 @@
unsigned int stepping;
};

-static struct cardinfo icside_cardinfo_v5 = {
+static struct cardinfo __init icside_cardinfo_v5 = {
ICS_ARCIN_V5_IDEOFFSET,
ICS_ARCIN_V5_IDEALTOFFSET,
ICS_ARCIN_V5_IDESTEPPING
};

-static struct cardinfo icside_cardinfo_v6_1 = {
+static struct cardinfo __init icside_cardinfo_v6_1 = {
ICS_ARCIN_V6_IDEOFFSET_1,
ICS_ARCIN_V6_IDEALTOFFSET_1,
ICS_ARCIN_V6_IDESTEPPING
};

-static struct cardinfo icside_cardinfo_v6_2 = {
+static struct cardinfo __init icside_cardinfo_v6_2 = {
ICS_ARCIN_V6_IDEOFFSET_2,
ICS_ARCIN_V6_IDEALTOFFSET_2,
ICS_ARCIN_V6_IDESTEPPING
};

-static const card_ids icside_cids[] = {
+static const card_ids __init icside_cids[] = {
{ MANU_ICS, PROD_ICS_IDE },
{ MANU_ICS2, PROD_ICS2_IDE },
{ 0xffff, 0xffff }
@@ -159,7 +159,7 @@
* Purpose : identify IDE interface type
* Notes : checks the description string
*/
-static iftype_t icside_identifyif (struct expansion_card *ec)
+static iftype_t __init icside_identifyif (struct expansion_card *ec)
{
unsigned int addr;
iftype_t iftype;
@@ -422,7 +422,7 @@
}
}

-static unsigned long
+static unsigned long __init
icside_alloc_dmatable(void)
{
static unsigned long dmatable;
@@ -448,7 +448,7 @@
return table;
}

-static int
+static int __init
icside_setup_dma(ide_hwif_t *hwif, int autodma)
{
unsigned long table = icside_alloc_dmatable();
@@ -470,7 +470,7 @@
}
#endif

-static ide_hwif_t *
+static ide_hwif_t * __init
icside_find_hwif(unsigned long dataport)
{
ide_hwif_t *hwif;
@@ -493,7 +493,7 @@
return hwif;
}

-static ide_hwif_t *
+static ide_hwif_t * __init
icside_setup(unsigned long base, struct cardinfo *info, int irq)
{
unsigned long port = base + info->dataoffset;
@@ -519,7 +519,7 @@
return hwif;
}

-static int icside_register_v5(struct expansion_card *ec, int autodma)
+static int __init icside_register_v5(struct expansion_card *ec, int autodma)
{
unsigned long slot_port;
ide_hwif_t *hwif;
@@ -541,7 +541,7 @@
return hwif ? 0 : -1;
}

-static int icside_register_v6(struct expansion_card *ec, int autodma)
+static int __init icside_register_v6(struct expansion_card *ec, int autodma)
{
unsigned long slot_port, port;
ide_hwif_t *hwif, *mate;
@@ -599,7 +599,7 @@
return hwif || mate ? 0 : -1;
}

-int icside_init(void)
+int __init icside_init(void)
{
int autodma = 0;

diff -u --recursive 2.3.44/drivers/block/ide.c linux/drivers/block/ide.c
--- 2.3.44/drivers/block/ide.c Sat Feb 12 23:03:47 2000
+++ linux/drivers/block/ide.c Sun Feb 13 00:32:38 2000
@@ -281,7 +281,7 @@
* for the max possible number (MAX_HWIFS * MAX_DRIVES) of them.
*/
#define MAGIC_COOKIE 0x12345678
-static void init_ide_data (void)
+static void __init init_ide_data (void)
{
unsigned int index;
static unsigned long magic_cookie = MAGIC_COOKIE;
diff -u --recursive 2.3.44/drivers/block/macide.c linux/drivers/block/macide.c
--- 2.3.44/drivers/block/macide.c Sat Sep 4 22:07:19 1999
+++ linux/drivers/block/macide.c Sun Feb 13 01:53:57 2000
@@ -43,7 +43,7 @@
#define MAC_HD_STATUS 0x1c /* see status-bits */
#define MAC_HD_CONTROL 0x38 /* control/altstatus */

-static int macide_offsets[IDE_NR_PORTS] = {
+static int __init macide_offsets[IDE_NR_PORTS] = {
MAC_HD_DATA, MAC_HD_ERROR, MAC_HD_NSECTOR, MAC_HD_SECTOR, MAC_HD_LCYL,
MAC_HD_HCYL, MAC_HD_SELECT, MAC_HD_STATUS, MAC_HD_CONTROL
};
@@ -84,7 +84,7 @@
* Probe for a Macintosh IDE interface
*/

-void macide_init(void)
+void __init macide_init(void)
{
hw_regs_t hw;
int index = -1;
diff -u --recursive 2.3.44/drivers/block/qd6580.c linux/drivers/block/qd6580.c
--- 2.3.44/drivers/block/qd6580.c Thu May 13 20:04:54 1999
+++ linux/drivers/block/qd6580.c Sun Feb 13 00:53:26 2000
@@ -60,7 +60,7 @@
restore_flags(flags); /* all CPUs */
}

-void init_qd6580 (void)
+void __init init_qd6580 (void)
{
ide_hwifs[0].chipset = ide_qd6580;
ide_hwifs[1].chipset = ide_qd6580;
diff -u --recursive 2.3.44/drivers/block/rapide.c linux/drivers/block/rapide.c
--- 2.3.44/drivers/block/rapide.c Thu Jun 17 10:11:35 1999
+++ linux/drivers/block/rapide.c Sun Feb 13 01:45:20 2000
@@ -16,7 +16,7 @@

#include <asm/ecard.h>

-static const card_ids rapide_cids[] = {
+static const card_ids __init rapide_cids[] = {
{ MANU_YELLOWSTONE, PROD_YELLOWSTONE_RAPIDE32 },
{ 0xffff, 0xffff }
};
@@ -43,7 +43,7 @@
return ide_register_hw(&hw, NULL);
}

-int rapide_init(void)
+int __init rapide_init(void)
{
int i;

diff -u --recursive 2.3.44/drivers/block/umc8672.c linux/drivers/block/umc8672.c
--- 2.3.44/drivers/block/umc8672.c Thu May 13 20:04:54 1999
+++ linux/drivers/block/umc8672.c Sun Feb 13 00:47:54 2000
@@ -76,7 +76,7 @@
outb_p (wert,0x109);
}

-static byte in_umc (char port)
+static inline byte in_umc (char port)
{
outb_p (port,0x108);
return inb_p (0x109);
@@ -125,7 +125,7 @@
restore_flags(flags); /* all CPUs */
}

-void init_umc8672 (void) /* called from ide.c */
+void __init init_umc8672 (void) /* called from ide.c */
{
unsigned long flags;

*************************************************************************

--
=======================================================================
Andrzej M. Krzysztofowicz ankry@mif.pg.gda.pl
tel. (0-58) 347 14 61
Wydz.Fizyki Technicznej i Matematyki Stosowanej Politechniki Gdanskiej
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.057 / U:2.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site