Commit fc08381f authored by Adrian Bunk's avatar Adrian Bunk Committed by Greg Kroah-Hartman

[PATCH] i2c-core.c: make some code static

This patch makes some needlessly global code static.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent f4fdd4cb
...@@ -38,12 +38,43 @@ static LIST_HEAD(drivers); ...@@ -38,12 +38,43 @@ static LIST_HEAD(drivers);
static DECLARE_MUTEX(core_lists); static DECLARE_MUTEX(core_lists);
static DEFINE_IDR(i2c_adapter_idr); static DEFINE_IDR(i2c_adapter_idr);
int i2c_device_probe(struct device *dev) /* match always succeeds, as we want the probe() to tell if we really accept this match */
static int i2c_device_match(struct device *dev, struct device_driver *drv)
{
return 1;
}
static int i2c_bus_suspend(struct device * dev, pm_message_t state)
{
int rc = 0;
if (dev->driver && dev->driver->suspend)
rc = dev->driver->suspend(dev,state,0);
return rc;
}
static int i2c_bus_resume(struct device * dev)
{
int rc = 0;
if (dev->driver && dev->driver->resume)
rc = dev->driver->resume(dev,0);
return rc;
}
static struct bus_type i2c_bus_type = {
.name = "i2c",
.match = i2c_device_match,
.suspend = i2c_bus_suspend,
.resume = i2c_bus_resume,
};
static int i2c_device_probe(struct device *dev)
{ {
return -ENODEV; return -ENODEV;
} }
int i2c_device_remove(struct device *dev) static int i2c_device_remove(struct device *dev)
{ {
return 0; return 0;
} }
...@@ -523,38 +554,6 @@ void i2c_clients_command(struct i2c_adapter *adap, unsigned int cmd, void *arg) ...@@ -523,38 +554,6 @@ void i2c_clients_command(struct i2c_adapter *adap, unsigned int cmd, void *arg)
up(&adap->clist_lock); up(&adap->clist_lock);
} }
/* match always succeeds, as we want the probe() to tell if we really accept this match */
static int i2c_device_match(struct device *dev, struct device_driver *drv)
{
return 1;
}
static int i2c_bus_suspend(struct device * dev, u32 state)
{
int rc = 0;
if (dev->driver && dev->driver->suspend)
rc = dev->driver->suspend(dev,state,0);
return rc;
}
static int i2c_bus_resume(struct device * dev)
{
int rc = 0;
if (dev->driver && dev->driver->resume)
rc = dev->driver->resume(dev,0);
return rc;
}
struct bus_type i2c_bus_type = {
.name = "i2c",
.match = i2c_device_match,
.suspend = i2c_bus_suspend,
.resume = i2c_bus_resume,
};
static int __init i2c_init(void) static int __init i2c_init(void)
{ {
int retval; int retval;
...@@ -860,7 +859,7 @@ crc8(u16 data) ...@@ -860,7 +859,7 @@ crc8(u16 data)
/* CRC over count bytes in the first array plus the bytes in the rest /* CRC over count bytes in the first array plus the bytes in the rest
array if it is non-null. rest[0] is the (length of rest) - 1 array if it is non-null. rest[0] is the (length of rest) - 1
and is included. */ and is included. */
u8 i2c_smbus_partial_pec(u8 crc, int count, u8 *first, u8 *rest) static u8 i2c_smbus_partial_pec(u8 crc, int count, u8 *first, u8 *rest)
{ {
int i; int i;
...@@ -872,7 +871,7 @@ u8 i2c_smbus_partial_pec(u8 crc, int count, u8 *first, u8 *rest) ...@@ -872,7 +871,7 @@ u8 i2c_smbus_partial_pec(u8 crc, int count, u8 *first, u8 *rest)
return crc; return crc;
} }
u8 i2c_smbus_pec(int count, u8 *first, u8 *rest) static u8 i2c_smbus_pec(int count, u8 *first, u8 *rest)
{ {
return i2c_smbus_partial_pec(0, count, first, rest); return i2c_smbus_partial_pec(0, count, first, rest);
} }
...@@ -880,8 +879,8 @@ u8 i2c_smbus_pec(int count, u8 *first, u8 *rest) ...@@ -880,8 +879,8 @@ u8 i2c_smbus_pec(int count, u8 *first, u8 *rest)
/* Returns new "size" (transaction type) /* Returns new "size" (transaction type)
Note that we convert byte to byte_data and byte_data to word_data Note that we convert byte to byte_data and byte_data to word_data
rather than invent new xxx_PEC transactions. */ rather than invent new xxx_PEC transactions. */
int i2c_smbus_add_pec(u16 addr, u8 command, int size, static int i2c_smbus_add_pec(u16 addr, u8 command, int size,
union i2c_smbus_data *data) union i2c_smbus_data *data)
{ {
u8 buf[3]; u8 buf[3];
...@@ -910,8 +909,8 @@ int i2c_smbus_add_pec(u16 addr, u8 command, int size, ...@@ -910,8 +909,8 @@ int i2c_smbus_add_pec(u16 addr, u8 command, int size,
return size; return size;
} }
int i2c_smbus_check_pec(u16 addr, u8 command, int size, u8 partial, static int i2c_smbus_check_pec(u16 addr, u8 command, int size, u8 partial,
union i2c_smbus_data *data) union i2c_smbus_data *data)
{ {
u8 buf[3], rpec, cpec; u8 buf[3], rpec, cpec;
......
...@@ -134,8 +134,6 @@ struct i2c_driver { ...@@ -134,8 +134,6 @@ struct i2c_driver {
}; };
#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
extern struct bus_type i2c_bus_type;
#define I2C_NAME_SIZE 50 #define I2C_NAME_SIZE 50
/* /*
......
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