@@ -39,8 +39,7 @@
#include "cbus.h"
-struct cbus_host *cbus_host = NULL;
-EXPORT_SYMBOL(cbus_host);
+static struct cbus_host *cbus_host;
#ifdef CONFIG_ARCH_OMAP1
/* We use our own MPUIO functions to get closer to 1MHz bus speed */
@@ -211,18 +210,18 @@ static int cbus_transfer(struct cbus_host *host, int dev, int reg, int data)
/*
* Read a given register from the device
*/
-int cbus_read_reg(struct cbus_host *host, int dev, int reg)
+int cbus_read_reg(int dev, int reg)
{
- return cbus_host ? cbus_transfer(host, dev, reg, -1) : -ENODEV;
+ return cbus_transfer(cbus_host, dev, reg, -1);
}
EXPORT_SYMBOL(cbus_read_reg);
/*
* Write to a given register of the device
*/
-int cbus_write_reg(struct cbus_host *host, int dev, int reg, u16 val)
+int cbus_write_reg(int dev, int reg, int val)
{
- return cbus_host ? cbus_transfer(host, dev, reg, (int)val) : -ENODEV;
+ return cbus_transfer(cbus_host, dev, reg, val);
}
EXPORT_SYMBOL(cbus_write_reg);
@@ -34,9 +34,7 @@ struct cbus_host {
int sel_gpio;
};
-extern struct cbus_host *cbus_host;
-
-extern int cbus_read_reg(struct cbus_host *host, int dev, int reg);
-extern int cbus_write_reg(struct cbus_host *host, int dev, int reg, u16 val);
+extern int cbus_read_reg(int dev, int reg);
+extern int cbus_write_reg(int dev, int reg, int val);
#endif /* __DRIVERS_CBUS_CBUS_H */
@@ -81,7 +81,7 @@ EXPORT_SYMBOL(retu_get_status);
int retu_read_reg(int reg)
{
BUG_ON(!retu_initialized);
- return cbus_read_reg(cbus_host, RETU_ID, reg);
+ return cbus_read_reg(RETU_ID, reg);
}
/**
@@ -94,7 +94,7 @@ int retu_read_reg(int reg)
void retu_write_reg(int reg, u16 val)
{
BUG_ON(!retu_initialized);
- cbus_write_reg(cbus_host, RETU_ID, reg, val);
+ cbus_write_reg(RETU_ID, reg, val);
}
void retu_set_clear_reg_bits(int reg, u16 set, u16 clear)
@@ -81,7 +81,7 @@ EXPORT_SYMBOL(tahvo_get_status);
int tahvo_read_reg(int reg)
{
BUG_ON(!tahvo_initialized);
- return cbus_read_reg(cbus_host, TAHVO_ID, reg);
+ return cbus_read_reg(TAHVO_ID, reg);
}
/**
@@ -94,7 +94,7 @@ int tahvo_read_reg(int reg)
void tahvo_write_reg(int reg, u16 val)
{
BUG_ON(!tahvo_initialized);
- cbus_write_reg(cbus_host, TAHVO_ID, reg, val);
+ cbus_write_reg(TAHVO_ID, reg, val);
}
/**