bus_find_devices() expects a non-const void * for its 3rd argument.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:27714,chrome-os-partner:8547
TEST=builds clean (without the following warning):
drivers/platform/x86/chromeos_laptop.c: In function 'find_i2c_adapter_num':
drivers/platform/x86/chromeos_laptop.c:193:10: warning: passing argument 3 of 'bus_find_device' discards 'const' qualifier from pointer target type [enabled by default]
include/linux/device.h:118:16: note: expected 'void *' but argument is of type 'char const *'
Change-Id: I24ee960408c0736f75a40c21598eed4ab1e5550a
Reviewed-on: https://gerrit.chromium.org/gerrit/18465
Commit-Ready: Benson Leung <bleung@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
{
struct device *dev = NULL;
struct i2c_adapter *adapter;
+ const char *name = i2c_adapter_names[type];
/* find the SMBus adapter */
- dev = bus_find_device(&i2c_bus_type, NULL, i2c_adapter_names[type],
+ dev = bus_find_device(&i2c_bus_type, NULL, (void *)name,
__find_i2c_adap);
if (!dev) {
pr_err("%s: i2c adapter %s not found on system.\n", __func__,
- i2c_adapter_names[type]);
+ name);
return -ENODEV;
}
adapter = to_i2c_adapter(dev);