diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2016-07-19 05:56:09 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2016-07-19 05:57:38 +0200 |
commit | 5b40f121ced215544531dc00201ea4e8f68671c1 (patch) | |
tree | 6e8fa15eb5807239b2f8dbccc027f5d067ce4cff /drivers/i2c | |
parent | 38d0fc4662474c6219166505d0a68b45a583fcfb (diff) |
Revert "i2c: core: Cleanup I2C ACPI namespace"
This reverts commit a7003b65801e17a19617a509b2dbae3442ddd709.There were
too heavy merge conflicts and the driver code making use of this was not
ready yet anyhow. So, we wait one cycle.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index abe41369eec1..b2b34a0a35a1 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -88,7 +88,7 @@ void i2c_transfer_trace_unreg(void) } #if defined(CONFIG_ACPI) -struct i2c_acpi_handler_data { +struct acpi_i2c_handler_data { struct acpi_connection_info info; struct i2c_adapter *adapter; }; @@ -103,15 +103,15 @@ struct gsb_buffer { }; } __packed; -struct i2c_acpi_lookup { +struct acpi_i2c_lookup { struct i2c_board_info *info; acpi_handle adapter_handle; acpi_handle device_handle; }; -static int i2c_acpi_find_address(struct acpi_resource *ares, void *data) +static int acpi_i2c_find_address(struct acpi_resource *ares, void *data) { - struct i2c_acpi_lookup *lookup = data; + struct acpi_i2c_lookup *lookup = data; struct i2c_board_info *info = lookup->info; struct acpi_resource_i2c_serialbus *sb; acpi_handle adapter_handle; @@ -140,12 +140,12 @@ static int i2c_acpi_find_address(struct acpi_resource *ares, void *data) return 1; } -static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level, +static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level, void *data, void **return_value) { struct i2c_adapter *adapter = data; struct list_head resource_list; - struct i2c_acpi_lookup lookup; + struct acpi_i2c_lookup lookup; struct resource_entry *entry; struct i2c_board_info info; struct acpi_device *adev; @@ -170,7 +170,7 @@ static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level, */ INIT_LIST_HEAD(&resource_list); ret = acpi_dev_get_resources(adev, &resource_list, - i2c_acpi_find_address, &lookup); + acpi_i2c_find_address, &lookup); acpi_dev_free_resource_list(&resource_list); if (ret < 0 || !info.addr) @@ -202,17 +202,17 @@ static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level, return AE_OK; } -#define I2C_ACPI_MAX_SCAN_DEPTH 32 +#define ACPI_I2C_MAX_SCAN_DEPTH 32 /** - * i2c_acpi_register_devices - enumerate I2C slave devices behind adapter + * acpi_i2c_register_devices - enumerate I2C slave devices behind adapter * @adap: pointer to adapter * * Enumerate all I2C slave devices behind this adapter by walking the ACPI * namespace. When a device is found it will be added to the Linux device * model and bound to the corresponding ACPI handle. */ -static void i2c_acpi_register_devices(struct i2c_adapter *adap) +static void acpi_i2c_register_devices(struct i2c_adapter *adap) { acpi_status status; @@ -220,15 +220,15 @@ static void i2c_acpi_register_devices(struct i2c_adapter *adap) return; status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - I2C_ACPI_MAX_SCAN_DEPTH, - i2c_acpi_add_device, NULL, + ACPI_I2C_MAX_SCAN_DEPTH, + acpi_i2c_add_device, NULL, adap, NULL); if (ACPI_FAILURE(status)) dev_warn(&adap->dev, "failed to enumerate I2C slaves\n"); } #else /* CONFIG_ACPI */ -static inline void i2c_acpi_register_devices(struct i2c_adapter *adap) { } +static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) { } #endif /* CONFIG_ACPI */ #ifdef CONFIG_ACPI_I2C_OPREGION @@ -293,12 +293,12 @@ static int acpi_gsb_i2c_write_bytes(struct i2c_client *client, } static acpi_status -i2c_acpi_space_handler(u32 function, acpi_physical_address command, +acpi_i2c_space_handler(u32 function, acpi_physical_address command, u32 bits, u64 *value64, void *handler_context, void *region_context) { struct gsb_buffer *gsb = (struct gsb_buffer *)value64; - struct i2c_acpi_handler_data *data = handler_context; + struct acpi_i2c_handler_data *data = handler_context; struct acpi_connection_info *info = &data->info; struct acpi_resource_i2c_serialbus *sb; struct i2c_adapter *adapter = data->adapter; @@ -417,10 +417,10 @@ i2c_acpi_space_handler(u32 function, acpi_physical_address command, } -static int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) +static int acpi_i2c_install_space_handler(struct i2c_adapter *adapter) { acpi_handle handle; - struct i2c_acpi_handler_data *data; + struct acpi_i2c_handler_data *data; acpi_status status; if (!adapter->dev.parent) @@ -431,7 +431,7 @@ static int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) if (!handle) return -ENODEV; - data = kzalloc(sizeof(struct i2c_acpi_handler_data), + data = kzalloc(sizeof(struct acpi_i2c_handler_data), GFP_KERNEL); if (!data) return -ENOMEM; @@ -445,7 +445,7 @@ static int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) status = acpi_install_address_space_handler(handle, ACPI_ADR_SPACE_GSBUS, - &i2c_acpi_space_handler, + &acpi_i2c_space_handler, NULL, data); if (ACPI_FAILURE(status)) { @@ -459,10 +459,10 @@ static int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) return 0; } -static void i2c_acpi_remove_space_handler(struct i2c_adapter *adapter) +static void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter) { acpi_handle handle; - struct i2c_acpi_handler_data *data; + struct acpi_i2c_handler_data *data; acpi_status status; if (!adapter->dev.parent) @@ -475,7 +475,7 @@ static void i2c_acpi_remove_space_handler(struct i2c_adapter *adapter) acpi_remove_address_space_handler(handle, ACPI_ADR_SPACE_GSBUS, - &i2c_acpi_space_handler); + &acpi_i2c_space_handler); status = acpi_bus_get_private_data(handle, (void **)&data); if (ACPI_SUCCESS(status)) @@ -484,10 +484,10 @@ static void i2c_acpi_remove_space_handler(struct i2c_adapter *adapter) acpi_bus_detach_private_data(handle); } #else /* CONFIG_ACPI_I2C_OPREGION */ -static inline void i2c_acpi_remove_space_handler(struct i2c_adapter *adapter) +static inline void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter) { } -static inline int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) +static inline int acpi_i2c_install_space_handler(struct i2c_adapter *adapter) { return 0; } #endif /* CONFIG_ACPI_I2C_OPREGION */ @@ -1657,8 +1657,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap) /* create pre-declared device nodes */ of_i2c_register_devices(adap); - i2c_acpi_register_devices(adap); - i2c_acpi_install_space_handler(adap); + acpi_i2c_register_devices(adap); + acpi_i2c_install_space_handler(adap); if (adap->nr < __i2c_first_dynamic_bus_num) i2c_scan_static_board_info(adap); @@ -1830,7 +1830,7 @@ void i2c_del_adapter(struct i2c_adapter *adap) return; } - i2c_acpi_remove_space_handler(adap); + acpi_i2c_remove_space_handler(adap); /* Tell drivers about this removal */ mutex_lock(&core_lock); bus_for_each_drv(&i2c_bus_type, NULL, adap, |