Commit 4c0d46d2 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

staging: ks7010: sdio: remove forward declarations

Move read/write functions to the top and driver struct to the end, so we
can remove all forward declarations.
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c4730a92
...@@ -34,14 +34,6 @@ static const struct sdio_device_id ks7010_sdio_ids[] = { ...@@ -34,14 +34,6 @@ static const struct sdio_device_id ks7010_sdio_ids[] = {
}; };
MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids); MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
static int ks7010_sdio_probe(struct sdio_func *function,
const struct sdio_device_id *device);
static void ks7010_sdio_remove(struct sdio_func *function);
static void ks7010_rw_function(struct work_struct *work);
static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length);
static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length);
/* macro */ /* macro */
#define inc_txqhead(priv) \ #define inc_txqhead(priv) \
...@@ -58,6 +50,45 @@ static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address, ...@@ -58,6 +50,45 @@ static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
#define cnt_rxqbody(priv) \ #define cnt_rxqbody(priv) \
(((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE ) (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE )
static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length)
{
struct ks_sdio_card *card;
int rc;
card = priv->ks_wlan_hw.sdio_card;
if (length == 1) /* CMD52 */
*buffer = sdio_readb(card->func, address, &rc);
else /* CMD53 multi-block transfer */
rc = sdio_memcpy_fromio(card->func, buffer, address, length);
if (rc != 0)
DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
return rc;
}
static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length)
{
struct ks_sdio_card *card;
int rc;
card = priv->ks_wlan_hw.sdio_card;
if (length == 1) /* CMD52 */
sdio_writeb(card->func, *buffer, (unsigned int)address, &rc);
else /* CMD53 */
rc = sdio_memcpy_toio(card->func, (unsigned int)address, buffer,
length);
if (rc != 0)
DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
return rc;
}
void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv) void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
{ {
unsigned char rw_data; unsigned char rw_data;
...@@ -230,45 +261,6 @@ int ks_wlan_hw_power_save(struct ks_wlan_private *priv) ...@@ -230,45 +261,6 @@ int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
return 0; return 0;
} }
static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length)
{
struct ks_sdio_card *card;
int rc;
card = priv->ks_wlan_hw.sdio_card;
if (length == 1) /* CMD52 */
*buffer = sdio_readb(card->func, address, &rc);
else /* CMD53 multi-block transfer */
rc = sdio_memcpy_fromio(card->func, buffer, address, length);
if (rc != 0)
DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
return rc;
}
static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length)
{
struct ks_sdio_card *card;
int rc;
card = priv->ks_wlan_hw.sdio_card;
if (length == 1) /* CMD52 */
sdio_writeb(card->func, *buffer, (unsigned int)address, &rc);
else /* CMD53 */
rc = sdio_memcpy_toio(card->func, (unsigned int)address, buffer,
length);
if (rc != 0)
DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
return rc;
}
static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p, static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
unsigned long size, unsigned long size,
void (*complete_handler) (void *arg1, void *arg2), void (*complete_handler) (void *arg1, void *arg2),
...@@ -951,13 +943,6 @@ static void ks7010_card_init(struct ks_wlan_private *priv) ...@@ -951,13 +943,6 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
} }
} }
static struct sdio_driver ks7010_sdio_driver = {
.name = "ks7010_sdio",
.id_table = ks7010_sdio_ids,
.probe = ks7010_sdio_probe,
.remove = ks7010_sdio_remove,
};
static void ks7010_init_defaults(struct ks_wlan_private *priv) static void ks7010_init_defaults(struct ks_wlan_private *priv)
{ {
priv->reg.tx_rate = TX_RATE_AUTO; priv->reg.tx_rate = TX_RATE_AUTO;
...@@ -1239,6 +1224,13 @@ static void ks7010_sdio_remove(struct sdio_func *func) ...@@ -1239,6 +1224,13 @@ static void ks7010_sdio_remove(struct sdio_func *func)
return; return;
} }
static struct sdio_driver ks7010_sdio_driver = {
.name = "ks7010_sdio",
.id_table = ks7010_sdio_ids,
.probe = ks7010_sdio_probe,
.remove = ks7010_sdio_remove,
};
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver); module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
MODULE_AUTHOR("Sang Engineering, Qi-Hardware, KeyStream"); MODULE_AUTHOR("Sang Engineering, Qi-Hardware, KeyStream");
MODULE_DESCRIPTION("Driver for KeyStream KS7010 based SDIO cards"); MODULE_DESCRIPTION("Driver for KeyStream KS7010 based SDIO cards");
......
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