CHROMIUM: platform/x86 - fix compiler warning for args of bus_find_devices
authorDaniel Kurtz <djkurtz@chromium.org>
Mon, 19 Mar 2012 16:20:29 +0000 (00:20 +0800)
committerGrant Grundler <grundler@google.com>
Thu, 24 May 2012 22:14:40 +0000 (15:14 -0700)
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>
drivers/platform/x86/chromeos_laptop.c

index 3678107..b4b4980 100644 (file)
@@ -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);