From: Daniel Kurtz Date: Mon, 19 Mar 2012 16:20:29 +0000 (+0800) Subject: CHROMIUM: platform/x86 - fix compiler warning for args of bus_find_devices X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=8f5eb6dcc06485026c42835c3a873e9087d56f15;p=cascardo%2Flinux.git CHROMIUM: platform/x86 - fix compiler warning for args of bus_find_devices bus_find_devices() expects a non-const void * for its 3rd argument. Signed-off-by: Daniel Kurtz 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 Reviewed-by: Benson Leung Tested-by: Benson Leung --- diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c index 3678107506a6..b4b49804519c 100644 --- a/drivers/platform/x86/chromeos_laptop.c +++ b/drivers/platform/x86/chromeos_laptop.c @@ -188,12 +188,13 @@ static int find_i2c_adapter_num(enum i2c_adapter_type type) { 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);