mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-28 13:14:39 +02:00
112 lines
4.3 KiB
Diff
112 lines
4.3 KiB
Diff
|
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
|
||
|
|