aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/s3c24xx/patches-2.6.26/0135-tracking-2.6.26-rc1-sdio-pnp-changes.patch.patch
blob: c7ac432297417fe1cf575eda67137e38175b803d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From 5986281af77185adca248453ca06ce4bcca6bfb9 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@openmoko.com>
Date: Fri, 25 Jul 2008 23:06:07 +0100
Subject: [PATCH] tracking-2.6.26-rc1-sdio-pnp-changes.patch
 Signed-off-by: Andy Green <andy@openmoko.com>

---
 drivers/sdio/stack/busdriver/sdio_bus_os.c |   33 +++++++++++-----------------
 1 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/sdio/stack/busdriver/sdio_bus_os.c b/drivers/sdio/stack/busdriver/sdio_bus_os.c
index dbdb955..2650d93 100644
--- a/drivers/sdio/stack/busdriver/sdio_bus_os.c
+++ b/drivers/sdio/stack/busdriver/sdio_bus_os.c
@@ -60,6 +60,8 @@ void pnp_remove_card_device(struct pnp_dev *dev);
 #include <linux/sdio/sdio_busdriver.h>
 #include <linux/sdio/sdio_lib.h>
 #include "_busdriver.h"
+/* new for 2.6.26-rc1 --- not sure this is a great way... */
+#include "../../../pnp/base.h"
 
 #define DESCRIPTION "SDIO Bus Driver"
 #define AUTHOR "Atheros Communications, Inc."
@@ -369,14 +371,14 @@ static spinlock_t InUseDevicesLock = SPIN_LOCK_UNLOCKED;
 static const struct pnp_device_id pnp_idtable[] = {
     {"SD_XXXX",  0}
 };
-static int sdio_get_resources(struct pnp_dev * pDev, struct pnp_resource_table * res)
+static int sdio_get_resources(struct pnp_dev * pDev)
 {
     DBG_PRINT(SDDBG_TRACE,
         ("SDIO BusDriver - sdio_get_resources: %s\n",
         pDev->dev.bus_id));
     return 0;
 }
-static int sdio_set_resources(struct pnp_dev * pDev, struct pnp_resource_table * res)
+static int sdio_set_resources(struct pnp_dev * pDev)
 {
     DBG_PRINT(SDDBG_TRACE,
         ("SDIO BusDriver - sdio_set_resources: %s\n",
@@ -494,7 +496,8 @@ static int UnregisterDriver(PSDFUNCTION pFunction)
 */
 SDIO_STATUS OS_InitializeDevice(PSDDEVICE pDevice, PSDFUNCTION pFunction)
 {
-    struct pnp_id *pFdname;
+	char id_name[20];
+
     memset(&pDevice->Device, 0, sizeof(pDevice->Device));
     pDevice->Device.dev.driver_data = (PVOID)pFunction;
 //??    pDevice->Device.data = (PVOID)pFunction;
@@ -510,20 +513,12 @@ SDIO_STATUS OS_InitializeDevice(PSDDEVICE pDevice, PSDFUNCTION pFunction)
     pDevice->Device.protocol = &sdio_protocol;
     pDevice->Device.active = 1;
 
-    pnp_init_resource_table(&pDevice->Device.res);
-
-    pFdname = KernelAlloc(sizeof(struct pnp_id));
-
-    if (NULL == pFdname) {
-        return SDIO_STATUS_NO_RESOURCES;
-    }
     /* set the id as slot number/function number */
-    snprintf(pFdname->id, sizeof(pFdname->id), "SD_%02X%02X",
+    snprintf(id_name, sizeof(id_name) - 1, "SD_%02X%02X",
              pDevice->pHcd->SlotNumber, (UINT)SDDEVICE_GET_SDIO_FUNCNO(pDevice));
-    pFdname->next = NULL;
     DBG_PRINT(SDDBG_TRACE, ("SDIO BusDriver - OS_InitializeDevice adding id: %s\n",
-                             pFdname->id));
-    pnp_add_id(pFdname, &pDevice->Device);
+                             id_name));
+    pnp_add_id(&pDevice->Device, id_name);
 
         /* deal with DMA settings */
     if (pDevice->pHcd->pDmaDescription != NULL) {
@@ -620,9 +615,9 @@ void OS_RemoveDevice(PSDDEVICE pDevice)
 SDIO_STATUS SDIO_BusAddOSDevice(PSDDMA_DESCRIPTION pDma, POS_PNPDRIVER pDriver, POS_PNPDEVICE pDevice)
 {
     int err;
-    struct pnp_id *pFdname;
     struct pnp_device_id *pFdid;
     static int slotNumber = 0; /* we just use an increasing count for the slots number */
+	char id_name[20];
 
     if (pDma != NULL) {
         pDevice->dev.dma_mask = &pDma->Mask;
@@ -653,19 +648,17 @@ SDIO_STATUS SDIO_BusAddOSDevice(PSDDMA_DESCRIPTION pDma, POS_PNPDRIVER pDriver,
     pDevice->capabilities = PNP_REMOVABLE | PNP_DISABLE;
     pDevice->active = 1;
 
-    pFdname = KernelAlloc(sizeof(struct pnp_id));
     /* set the id as slot number/function number */
-    snprintf(pFdname->id, sizeof(pFdname->id), "SD_%02X08",
+    snprintf(id_name, sizeof(id_name) - 1, "SD_%02X08",
              0); //??pDevice->pHcd->SlotNumber);//?????fix this, slotnumber isn't vaialble yet
-    pFdname->next = NULL;
-    pnp_add_id(pFdname, pDevice);
+    pnp_add_id(pDevice, id_name);
 
     /* get a unique device number */
     spin_lock(&InUseDevicesLock);
     pDevice->number = FirstClearBit(&InUseDevices);
     SetBit(&InUseDevices, pDevice->number);
     spin_unlock(&InUseDevicesLock);
-    pnp_init_resource_table(&pDevice->res);
+
     err = pnp_add_device(pDevice);
     if (err < 0) {
         DBG_PRINT(SDDBG_ERROR, ("SDIO BusDriver - SDIO_GetBusOSDevice failed pnp_device_add: %d\n",
-- 
1.5.6.3