Skip to content

Commit 390fd04

Browse files
Wolfram Sangwsakernel
authored andcommitted
i2c: remove deprecated i2c_new_device API
All in-tree users have been converted to the new i2c_new_client_device function, so remove this deprecated one. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent bc5a3e4 commit 390fd04

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

drivers/i2c/i2c-core-base.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -815,31 +815,6 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf
815815
}
816816
EXPORT_SYMBOL_GPL(i2c_new_client_device);
817817

818-
/**
819-
* i2c_new_device - instantiate an i2c device
820-
* @adap: the adapter managing the device
821-
* @info: describes one I2C device; bus_num is ignored
822-
* Context: can sleep
823-
*
824-
* This deprecated function has the same functionality as
825-
* @i2c_new_client_device, it just returns NULL instead of an ERR_PTR in case of
826-
* an error for compatibility with current I2C API. It will be removed once all
827-
* users are converted.
828-
*
829-
* This returns the new i2c client, which may be saved for later use with
830-
* i2c_unregister_device(); or NULL to indicate an error.
831-
*/
832-
struct i2c_client *
833-
i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
834-
{
835-
struct i2c_client *ret;
836-
837-
ret = i2c_new_client_device(adap, info);
838-
return IS_ERR(ret) ? NULL : ret;
839-
}
840-
EXPORT_SYMBOL_GPL(i2c_new_device);
841-
842-
843818
/**
844819
* i2c_unregister_device - reverse effect of i2c_new_*_device()
845820
* @client: value returned from i2c_new_*_device()

include/linux/i2c.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }
408408
* that are present. This information is used to grow the driver model tree.
409409
* For mainboards this is done statically using i2c_register_board_info();
410410
* bus numbers identify adapters that aren't yet available. For add-on boards,
411-
* i2c_new_device() does this dynamically with the adapter already known.
411+
* i2c_new_client_device() does this dynamically with the adapter already known.
412412
*/
413413
struct i2c_board_info {
414414
char type[I2C_NAME_SIZE];
@@ -439,13 +439,11 @@ struct i2c_board_info {
439439

440440

441441
#if IS_ENABLED(CONFIG_I2C)
442-
/* Add-on boards should register/unregister their devices; e.g. a board
442+
/*
443+
* Add-on boards should register/unregister their devices; e.g. a board
443444
* with integrated I2C, a config eeprom, sensors, and a codec that's
444445
* used in conjunction with the primary hardware.
445446
*/
446-
struct i2c_client *
447-
i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
448-
449447
struct i2c_client *
450448
i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
451449

0 commit comments

Comments
 (0)