aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-05-01 17:26:31 -0400
committerJean Delvare <khali@hyperion.delvare>2007-05-01 17:26:31 -0400
commitc05646069ccf8e94031ca9c8ab18fff35ba4405e (patch)
tree74d18b7968d3e4265a0fd56cc0b143ddf274b074
parent6e13e641841833cc2aa5baefe89bb04bc388801b (diff)
i2c: i2c EXPORT_SYMBOL cleanup
Make i2c-core.c obey Documentation/CodingStyle better by snugging the EXPORT_SYMBOL declarations next to the relevant definitions. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
-rw-r--r--drivers/i2c/i2c-core.c64
1 files changed, 28 insertions, 36 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index c50229bd9f85..18124398b464 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -201,6 +201,7 @@ struct bus_type i2c_bus_type = {
201 .suspend = i2c_device_suspend, 201 .suspend = i2c_device_suspend,
202 .resume = i2c_device_resume, 202 .resume = i2c_device_resume,
203}; 203};
204EXPORT_SYMBOL_GPL(i2c_bus_type);
204 205
205/** 206/**
206 * i2c_new_device - instantiate an i2c device for use with a new style driver 207 * i2c_new_device - instantiate an i2c device for use with a new style driver
@@ -285,6 +286,7 @@ void i2c_adapter_dev_release(struct device *dev)
285 struct i2c_adapter *adap = to_i2c_adapter(dev); 286 struct i2c_adapter *adap = to_i2c_adapter(dev);
286 complete(&adap->dev_released); 287 complete(&adap->dev_released);
287} 288}
289EXPORT_SYMBOL_GPL(i2c_adapter_dev_release); /* exported to i2c-isa */
288 290
289static ssize_t 291static ssize_t
290show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf) 292show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
@@ -303,6 +305,7 @@ struct class i2c_adapter_class = {
303 .name = "i2c-adapter", 305 .name = "i2c-adapter",
304 .dev_attrs = i2c_adapter_attrs, 306 .dev_attrs = i2c_adapter_attrs,
305}; 307};
308EXPORT_SYMBOL_GPL(i2c_adapter_class); /* exported to i2c-isa */
306 309
307static void i2c_scan_static_board_info(struct i2c_adapter *adapter) 310static void i2c_scan_static_board_info(struct i2c_adapter *adapter)
308{ 311{
@@ -533,6 +536,7 @@ int i2c_del_adapter(struct i2c_adapter *adap)
533 mutex_unlock(&core_lists); 536 mutex_unlock(&core_lists);
534 return res; 537 return res;
535} 538}
539EXPORT_SYMBOL(i2c_del_adapter);
536 540
537 541
538/* ------------------------------------------------------------------------- */ 542/* ------------------------------------------------------------------------- */
@@ -650,6 +654,7 @@ int i2c_del_driver(struct i2c_driver *driver)
650 mutex_unlock(&core_lists); 654 mutex_unlock(&core_lists);
651 return 0; 655 return 0;
652} 656}
657EXPORT_SYMBOL(i2c_del_driver);
653 658
654/* ------------------------------------------------------------------------- */ 659/* ------------------------------------------------------------------------- */
655 660
@@ -676,6 +681,7 @@ int i2c_check_addr(struct i2c_adapter *adapter, int addr)
676 681
677 return rval; 682 return rval;
678} 683}
684EXPORT_SYMBOL(i2c_check_addr);
679 685
680int i2c_attach_client(struct i2c_client *client) 686int i2c_attach_client(struct i2c_client *client)
681{ 687{
@@ -729,7 +735,7 @@ out_unlock:
729 mutex_unlock(&adapter->clist_lock); 735 mutex_unlock(&adapter->clist_lock);
730 return res; 736 return res;
731} 737}
732 738EXPORT_SYMBOL(i2c_attach_client);
733 739
734int i2c_detach_client(struct i2c_client *client) 740int i2c_detach_client(struct i2c_client *client)
735{ 741{
@@ -762,6 +768,7 @@ int i2c_detach_client(struct i2c_client *client)
762 out: 768 out:
763 return res; 769 return res;
764} 770}
771EXPORT_SYMBOL(i2c_detach_client);
765 772
766static int i2c_inc_use_client(struct i2c_client *client) 773static int i2c_inc_use_client(struct i2c_client *client)
767{ 774{
@@ -794,6 +801,7 @@ int i2c_use_client(struct i2c_client *client)
794 801
795 return 0; 802 return 0;
796} 803}
804EXPORT_SYMBOL(i2c_use_client);
797 805
798int i2c_release_client(struct i2c_client *client) 806int i2c_release_client(struct i2c_client *client)
799{ 807{
@@ -808,6 +816,7 @@ int i2c_release_client(struct i2c_client *client)
808 816
809 return 0; 817 return 0;
810} 818}
819EXPORT_SYMBOL(i2c_release_client);
811 820
812void i2c_clients_command(struct i2c_adapter *adap, unsigned int cmd, void *arg) 821void i2c_clients_command(struct i2c_adapter *adap, unsigned int cmd, void *arg)
813{ 822{
@@ -828,6 +837,7 @@ void i2c_clients_command(struct i2c_adapter *adap, unsigned int cmd, void *arg)
828 } 837 }
829 mutex_unlock(&adap->clist_lock); 838 mutex_unlock(&adap->clist_lock);
830} 839}
840EXPORT_SYMBOL(i2c_clients_command);
831 841
832static int __init i2c_init(void) 842static int __init i2c_init(void)
833{ 843{
@@ -877,6 +887,7 @@ int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num)
877 return -ENOSYS; 887 return -ENOSYS;
878 } 888 }
879} 889}
890EXPORT_SYMBOL(i2c_transfer);
880 891
881int i2c_master_send(struct i2c_client *client,const char *buf ,int count) 892int i2c_master_send(struct i2c_client *client,const char *buf ,int count)
882{ 893{
@@ -895,6 +906,7 @@ int i2c_master_send(struct i2c_client *client,const char *buf ,int count)
895 transmitted, else error code. */ 906 transmitted, else error code. */
896 return (ret == 1) ? count : ret; 907 return (ret == 1) ? count : ret;
897} 908}
909EXPORT_SYMBOL(i2c_master_send);
898 910
899int i2c_master_recv(struct i2c_client *client, char *buf ,int count) 911int i2c_master_recv(struct i2c_client *client, char *buf ,int count)
900{ 912{
@@ -914,7 +926,7 @@ int i2c_master_recv(struct i2c_client *client, char *buf ,int count)
914 transmitted, else error code. */ 926 transmitted, else error code. */
915 return (ret == 1) ? count : ret; 927 return (ret == 1) ? count : ret;
916} 928}
917 929EXPORT_SYMBOL(i2c_master_recv);
918 930
919int i2c_control(struct i2c_client *client, 931int i2c_control(struct i2c_client *client,
920 unsigned int cmd, unsigned long arg) 932 unsigned int cmd, unsigned long arg)
@@ -936,6 +948,7 @@ int i2c_control(struct i2c_client *client,
936 } 948 }
937 return ret; 949 return ret;
938} 950}
951EXPORT_SYMBOL(i2c_control);
939 952
940/* ---------------------------------------------------- 953/* ----------------------------------------------------
941 * the i2c address scanning function 954 * the i2c address scanning function
@@ -1077,6 +1090,7 @@ int i2c_probe(struct i2c_adapter *adapter,
1077 1090
1078 return 0; 1091 return 0;
1079} 1092}
1093EXPORT_SYMBOL(i2c_probe);
1080 1094
1081struct i2c_adapter* i2c_get_adapter(int id) 1095struct i2c_adapter* i2c_get_adapter(int id)
1082{ 1096{
@@ -1090,11 +1104,13 @@ struct i2c_adapter* i2c_get_adapter(int id)
1090 mutex_unlock(&core_lists); 1104 mutex_unlock(&core_lists);
1091 return adapter; 1105 return adapter;
1092} 1106}
1107EXPORT_SYMBOL(i2c_get_adapter);
1093 1108
1094void i2c_put_adapter(struct i2c_adapter *adap) 1109void i2c_put_adapter(struct i2c_adapter *adap)
1095{ 1110{
1096 module_put(adap->owner); 1111 module_put(adap->owner);
1097} 1112}
1113EXPORT_SYMBOL(i2c_put_adapter);
1098 1114
1099/* The SMBus parts */ 1115/* The SMBus parts */
1100 1116
@@ -1163,6 +1179,7 @@ s32 i2c_smbus_write_quick(struct i2c_client *client, u8 value)
1163 return i2c_smbus_xfer(client->adapter,client->addr,client->flags, 1179 return i2c_smbus_xfer(client->adapter,client->addr,client->flags,
1164 value,0,I2C_SMBUS_QUICK,NULL); 1180 value,0,I2C_SMBUS_QUICK,NULL);
1165} 1181}
1182EXPORT_SYMBOL(i2c_smbus_write_quick);
1166 1183
1167s32 i2c_smbus_read_byte(struct i2c_client *client) 1184s32 i2c_smbus_read_byte(struct i2c_client *client)
1168{ 1185{
@@ -1173,12 +1190,14 @@ s32 i2c_smbus_read_byte(struct i2c_client *client)
1173 else 1190 else
1174 return data.byte; 1191 return data.byte;
1175} 1192}
1193EXPORT_SYMBOL(i2c_smbus_read_byte);
1176 1194
1177s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value) 1195s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value)
1178{ 1196{
1179 return i2c_smbus_xfer(client->adapter,client->addr,client->flags, 1197 return i2c_smbus_xfer(client->adapter,client->addr,client->flags,
1180 I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL); 1198 I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL);
1181} 1199}
1200EXPORT_SYMBOL(i2c_smbus_write_byte);
1182 1201
1183s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command) 1202s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command)
1184{ 1203{
@@ -1189,6 +1208,7 @@ s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command)
1189 else 1208 else
1190 return data.byte; 1209 return data.byte;
1191} 1210}
1211EXPORT_SYMBOL(i2c_smbus_read_byte_data);
1192 1212
1193s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 command, u8 value) 1213s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 command, u8 value)
1194{ 1214{
@@ -1198,6 +1218,7 @@ s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 command, u8 value)
1198 I2C_SMBUS_WRITE,command, 1218 I2C_SMBUS_WRITE,command,
1199 I2C_SMBUS_BYTE_DATA,&data); 1219 I2C_SMBUS_BYTE_DATA,&data);
1200} 1220}
1221EXPORT_SYMBOL(i2c_smbus_write_byte_data);
1201 1222
1202s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command) 1223s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command)
1203{ 1224{
@@ -1208,6 +1229,7 @@ s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command)
1208 else 1229 else
1209 return data.word; 1230 return data.word;
1210} 1231}
1232EXPORT_SYMBOL(i2c_smbus_read_word_data);
1211 1233
1212s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value) 1234s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value)
1213{ 1235{
@@ -1217,6 +1239,7 @@ s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value)
1217 I2C_SMBUS_WRITE,command, 1239 I2C_SMBUS_WRITE,command,
1218 I2C_SMBUS_WORD_DATA,&data); 1240 I2C_SMBUS_WORD_DATA,&data);
1219} 1241}
1242EXPORT_SYMBOL(i2c_smbus_write_word_data);
1220 1243
1221s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command, 1244s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command,
1222 u8 length, const u8 *values) 1245 u8 length, const u8 *values)
@@ -1231,6 +1254,7 @@ s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command,
1231 I2C_SMBUS_WRITE,command, 1254 I2C_SMBUS_WRITE,command,
1232 I2C_SMBUS_BLOCK_DATA,&data); 1255 I2C_SMBUS_BLOCK_DATA,&data);
1233} 1256}
1257EXPORT_SYMBOL(i2c_smbus_write_block_data);
1234 1258
1235/* Returns the number of read bytes */ 1259/* Returns the number of read bytes */
1236s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *values) 1260s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *values)
@@ -1245,6 +1269,7 @@ s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *val
1245 memcpy(values, &data.block[1], data.block[0]); 1269 memcpy(values, &data.block[1], data.block[0]);
1246 return data.block[0]; 1270 return data.block[0];
1247} 1271}
1272EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
1248 1273
1249s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command, 1274s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command,
1250 u8 length, const u8 *values) 1275 u8 length, const u8 *values)
@@ -1259,6 +1284,7 @@ s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command,
1259 I2C_SMBUS_WRITE, command, 1284 I2C_SMBUS_WRITE, command,
1260 I2C_SMBUS_I2C_BLOCK_DATA, &data); 1285 I2C_SMBUS_I2C_BLOCK_DATA, &data);
1261} 1286}
1287EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data);
1262 1288
1263/* Simulate a SMBus command using the i2c protocol 1289/* Simulate a SMBus command using the i2c protocol
1264 No checking of parameters is done! */ 1290 No checking of parameters is done! */
@@ -1445,41 +1471,7 @@ s32 i2c_smbus_xfer(struct i2c_adapter * adapter, u16 addr, unsigned short flags,
1445 1471
1446 return res; 1472 return res;
1447} 1473}
1448
1449
1450/* Next three are needed by i2c-isa */
1451EXPORT_SYMBOL_GPL(i2c_adapter_dev_release);
1452EXPORT_SYMBOL_GPL(i2c_adapter_class);
1453EXPORT_SYMBOL_GPL(i2c_bus_type);
1454
1455EXPORT_SYMBOL(i2c_del_adapter);
1456EXPORT_SYMBOL(i2c_del_driver);
1457EXPORT_SYMBOL(i2c_attach_client);
1458EXPORT_SYMBOL(i2c_detach_client);
1459EXPORT_SYMBOL(i2c_use_client);
1460EXPORT_SYMBOL(i2c_release_client);
1461EXPORT_SYMBOL(i2c_clients_command);
1462EXPORT_SYMBOL(i2c_check_addr);
1463
1464EXPORT_SYMBOL(i2c_master_send);
1465EXPORT_SYMBOL(i2c_master_recv);
1466EXPORT_SYMBOL(i2c_control);
1467EXPORT_SYMBOL(i2c_transfer);
1468EXPORT_SYMBOL(i2c_get_adapter);
1469EXPORT_SYMBOL(i2c_put_adapter);
1470EXPORT_SYMBOL(i2c_probe);
1471
1472EXPORT_SYMBOL(i2c_smbus_xfer); 1474EXPORT_SYMBOL(i2c_smbus_xfer);
1473EXPORT_SYMBOL(i2c_smbus_write_quick);
1474EXPORT_SYMBOL(i2c_smbus_read_byte);
1475EXPORT_SYMBOL(i2c_smbus_write_byte);
1476EXPORT_SYMBOL(i2c_smbus_read_byte_data);
1477EXPORT_SYMBOL(i2c_smbus_write_byte_data);
1478EXPORT_SYMBOL(i2c_smbus_read_word_data);
1479EXPORT_SYMBOL(i2c_smbus_write_word_data);
1480EXPORT_SYMBOL(i2c_smbus_write_block_data);
1481EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
1482EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data);
1483 1475
1484MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>"); 1476MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
1485MODULE_DESCRIPTION("I2C-Bus main module"); 1477MODULE_DESCRIPTION("I2C-Bus main module");