History

i2c: remove unneeded 'extern' from function declatations

According to coding-style.rst, extern should not be specified for exported functions.

Luca Ceresoli committed 6 years ago

Commit c807da51 parent d1eef1c1 file · +55 −60Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/i2c.h+55−60
@@ -50,8 +50,8 @@ struct property_entry; · 49 unmodified lines
50 * transmit an arbitrary number of messages without interruption.50 * transmit an arbitrary number of messages without interruption.
51 * @count must be be less than 64k since msg.len is u16.51 * @count must be be less than 64k since msg.len is u16.
52 */52 */
53extern int i2c_transfer_buffer_flags(const struct i2c_client *client,53int i2c_transfer_buffer_flags(const struct i2c_client *client,
54 char *buf, int count, u16 flags);54 char *buf, int count, u16 flags);
55 55
56/**56/**
57 * i2c_master_recv - issue a single I2C message in master receive mode57 * i2c_master_recv - issue a single I2C message in master receive mode
@@ -115,11 +115,9 @@ static inline int i2c_master_send_dmasafe(const struct i2c_client *client, · 57 unmodified lines
115 115
116/* Transfer num messages.116/* Transfer num messages.
117 */117 */
118extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,118int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
119 int num);
120/* Unlocked flavor */119/* Unlocked flavor */
121extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,120int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
122 int num);
123 121
124/* This is the very generalized SMBus access routine. You probably do not122/* This is the very generalized SMBus access routine. You probably do not
125 want to use this, though; one of the functions below may be much easier,123 want to use this, though; one of the functions below may be much easier,
@@ -138,16 +136,14 @@ s32 __i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, · 12 unmodified lines
138/* Now follow the 'nice' access routines. These also document the calling136/* Now follow the 'nice' access routines. These also document the calling
139 conventions of i2c_smbus_xfer. */137 conventions of i2c_smbus_xfer. */
140 138
141extern s32 i2c_smbus_read_byte(const struct i2c_client *client);139s32 i2c_smbus_read_byte(const struct i2c_client *client);
142extern s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value);140s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value);
143extern s32 i2c_smbus_read_byte_data(const struct i2c_client *client,141s32 i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command);
144 u8 command);142s32 i2c_smbus_write_byte_data(const struct i2c_client *client,
145extern s32 i2c_smbus_write_byte_data(const struct i2c_client *client,143 u8 command, u8 value);
146 u8 command, u8 value);144s32 i2c_smbus_read_word_data(const struct i2c_client *client, u8 command);
147extern s32 i2c_smbus_read_word_data(const struct i2c_client *client,145s32 i2c_smbus_write_word_data(const struct i2c_client *client,
148 u8 command);146 u8 command, u16 value);
149extern s32 i2c_smbus_write_word_data(const struct i2c_client *client,
150 u8 command, u16 value);
151 147
152static inline s32148static inline s32
153i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command)149i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command)
@@ -165,19 +161,18 @@ i2c_smbus_write_word_swapped(const struct i2c_client *client, · 11 unmodified lines
165}161}
166 162
167/* Returns the number of read bytes */163/* Returns the number of read bytes */
168extern s32 i2c_smbus_read_block_data(const struct i2c_client *client,164s32 i2c_smbus_read_block_data(const struct i2c_client *client,
169 u8 command, u8 *values);165 u8 command, u8 *values);
170extern s32 i2c_smbus_write_block_data(const struct i2c_client *client,166s32 i2c_smbus_write_block_data(const struct i2c_client *client,
171 u8 command, u8 length, const u8 *values);167 u8 command, u8 length, const u8 *values);
172/* Returns the number of read bytes */168/* Returns the number of read bytes */
173extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client,169s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client,
174 u8 command, u8 length, u8 *values);170 u8 command, u8 length, u8 *values);
175extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,171s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
176 u8 command, u8 length,172 u8 command, u8 length, const u8 *values);
177 const u8 *values);173s32 i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client,
178extern s32174 u8 command, u8 length,
179i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client,175 u8 *values);
180 u8 command, u8 length, u8 *values);
181int i2c_get_device_id(const struct i2c_client *client,176int i2c_get_device_id(const struct i2c_client *client,
182 struct i2c_device_identity *id);177 struct i2c_device_identity *id);
183#endif /* I2C */178#endif /* I2C */
@@ -337,10 +332,10 @@ struct i2c_client { · 153 unmodified lines
337};332};
338#define to_i2c_client(d) container_of(d, struct i2c_client, dev)333#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
339 334
340extern struct i2c_client *i2c_verify_client(struct device *dev);335struct i2c_client *i2c_verify_client(struct device *dev);
341extern struct i2c_adapter *i2c_verify_adapter(struct device *dev);336struct i2c_adapter *i2c_verify_adapter(struct device *dev);
342extern const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,337const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,
343 const struct i2c_client *client);338 const struct i2c_client *client);
344 339
345static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)340static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
346{341{
@@ -369,9 +364,9 @@ enum i2c_slave_event { · 22 unmodified lines
369 I2C_SLAVE_STOP,364 I2C_SLAVE_STOP,
370};365};
371 366
372extern int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb);367int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb);
373extern int i2c_slave_unregister(struct i2c_client *client);368int i2c_slave_unregister(struct i2c_client *client);
374extern bool i2c_detect_slave_mode(struct device *dev);369bool i2c_detect_slave_mode(struct device *dev);
375 370
376static inline int i2c_slave_event(struct i2c_client *client,371static inline int i2c_slave_event(struct i2c_client *client,
377 enum i2c_slave_event event, u8 *val)372 enum i2c_slave_event event, u8 *val)
@@ -440,10 +435,10 @@ struct i2c_board_info { · 62 unmodified lines
440 * with integrated I2C, a config eeprom, sensors, and a codec that's435 * with integrated I2C, a config eeprom, sensors, and a codec that's
441 * used in conjunction with the primary hardware.436 * used in conjunction with the primary hardware.
442 */437 */
443extern struct i2c_client *438struct i2c_client *
444i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);439i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
445 440
446extern struct i2c_client *441struct i2c_client *
447i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info);442i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
448 443
449/* If you don't know the exact address of an I2C device, use this variant444/* If you don't know the exact address of an I2C device, use this variant
@@ -452,33 +447,33 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf · 2 unmodified lines
452 * it must return 1 on successful probe, 0 otherwise. If it is not provided,447 * it must return 1 on successful probe, 0 otherwise. If it is not provided,
453 * a default probing method is used.448 * a default probing method is used.
454 */449 */
455extern struct i2c_client *450struct i2c_client *
456i2c_new_scanned_device(struct i2c_adapter *adap,451i2c_new_scanned_device(struct i2c_adapter *adap,
457 struct i2c_board_info *info,452 struct i2c_board_info *info,
458 unsigned short const *addr_list,453 unsigned short const *addr_list,
459 int (*probe)(struct i2c_adapter *adap, unsigned short addr));454 int (*probe)(struct i2c_adapter *adap, unsigned short addr));
460 455
461extern struct i2c_client *456struct i2c_client *
462i2c_new_probed_device(struct i2c_adapter *adap,457i2c_new_probed_device(struct i2c_adapter *adap,
463 struct i2c_board_info *info,458 struct i2c_board_info *info,
464 unsigned short const *addr_list,459 unsigned short const *addr_list,
465 int (*probe)(struct i2c_adapter *adap, unsigned short addr));460 int (*probe)(struct i2c_adapter *adap, unsigned short addr));
466 461
467/* Common custom probe functions */462/* Common custom probe functions */
468extern int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr);463int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr);
469 464
470extern struct i2c_client *465struct i2c_client *
471i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address);466i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address);
472 467
473extern struct i2c_client *468struct i2c_client *
474devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);469devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);
475 470
476extern struct i2c_client *471struct i2c_client *
477i2c_new_ancillary_device(struct i2c_client *client,472i2c_new_ancillary_device(struct i2c_client *client,
478 const char *name,473 const char *name,
479 u16 default_addr);474 u16 default_addr);
480 475
481extern void i2c_unregister_device(struct i2c_client *client);476void i2c_unregister_device(struct i2c_client *client);
482#endif /* I2C */477#endif /* I2C */
483 478
484/* Mainboard arch_initcall() code should register all its I2C devices.479/* Mainboard arch_initcall() code should register all its I2C devices.
@@ -486,7 +481,7 @@ extern void i2c_unregister_device(struct i2c_client *client); · 1 unmodified line
486 * Modules for add-on boards must use other calls.481 * Modules for add-on boards must use other calls.
487 */482 */
488#ifdef CONFIG_I2C_BOARDINFO483#ifdef CONFIG_I2C_BOARDINFO
489extern int484int
490i2c_register_board_info(int busnum, struct i2c_board_info const *info,485i2c_register_board_info(int busnum, struct i2c_board_info const *info,
491 unsigned n);486 unsigned n);
492#else487#else
@@ -840,12 +835,12 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap) · 347 unmodified lines
840/* administration...835/* administration...
841 */836 */
842#if IS_ENABLED(CONFIG_I2C)837#if IS_ENABLED(CONFIG_I2C)
843extern int i2c_add_adapter(struct i2c_adapter *adap);838int i2c_add_adapter(struct i2c_adapter *adap);
844extern void i2c_del_adapter(struct i2c_adapter *adap);839void i2c_del_adapter(struct i2c_adapter *adap);
845extern int i2c_add_numbered_adapter(struct i2c_adapter *adap);840int i2c_add_numbered_adapter(struct i2c_adapter *adap);
846 841
847extern int i2c_register_driver(struct module *owner, struct i2c_driver *driver);842int i2c_register_driver(struct module *owner, struct i2c_driver *driver);
848extern void i2c_del_driver(struct i2c_driver *driver);843void i2c_del_driver(struct i2c_driver *driver);
849 844
850/* use a define to avoid include chaining to get THIS_MODULE */845/* use a define to avoid include chaining to get THIS_MODULE */
851#define i2c_add_driver(driver) \846#define i2c_add_driver(driver) \
@@ -858,12 +853,12 @@ static inline bool i2c_client_has_driver(struct i2c_client *client) · 6 unmodified lines
858 853
859/* call the i2c_client->command() of all attached clients with854/* call the i2c_client->command() of all attached clients with
860 * the given arguments */855 * the given arguments */
861extern void i2c_clients_command(struct i2c_adapter *adap,856void i2c_clients_command(struct i2c_adapter *adap,
862 unsigned int cmd, void *arg);857 unsigned int cmd, void *arg);
863 858
864extern struct i2c_adapter *i2c_get_adapter(int nr);859struct i2c_adapter *i2c_get_adapter(int nr);
865extern void i2c_put_adapter(struct i2c_adapter *adap);860void i2c_put_adapter(struct i2c_adapter *adap);
866extern unsigned int i2c_adapter_depth(struct i2c_adapter *adapter);861unsigned int i2c_adapter_depth(struct i2c_adapter *adapter);
867 862
868void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_defaults);863void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_defaults);
869 864
@@ -935,15 +930,15 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr); · 65 unmodified lines
935 930
936#if IS_ENABLED(CONFIG_OF)931#if IS_ENABLED(CONFIG_OF)
937/* must call put_device() when done with returned i2c_client device */932/* must call put_device() when done with returned i2c_client device */
938extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);933struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
939 934
940/* must call put_device() when done with returned i2c_adapter device */935/* must call put_device() when done with returned i2c_adapter device */
941extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);936struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
942 937
943/* must call i2c_put_adapter() when done with returned i2c_adapter device */938/* must call i2c_put_adapter() when done with returned i2c_adapter device */
944struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node);939struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node);
945 940
946extern const struct of_device_id941const struct of_device_id
947*i2c_of_match_device(const struct of_device_id *matches,942*i2c_of_match_device(const struct of_device_id *matches,
948 struct i2c_client *client);943 struct i2c_client *client);
949 944