[hid:for-4.10/i2c-hid 6/7] drivers/hid/i2c-hid/i2c-hid.c:1048:23: error: implicit declaration of function 'devm_regulator_get'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git for-4.10/i2c-hid
head:   de3c99488609284e454cf2b4420a789038a4cfa8
commit: ead0687fe304a66a24e3d809d1070684f3abee71 [6/7] HID: i2c-hid: support regulator power on/off
config: x86_64-randconfig-x015-201649 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout ead0687fe304a66a24e3d809d1070684f3abee71
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   drivers/hid/i2c-hid/i2c-hid.c: In function 'i2c_hid_probe':
>> drivers/hid/i2c-hid/i2c-hid.c:1048:23: error: implicit declaration of function 'devm_regulator_get' [-Werror=implicit-function-declaration]
     ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd");
                          ^~~~~~~~~~~~~~~~~~
>> drivers/hid/i2c-hid/i2c-hid.c:1048:21: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd");
                        ^
>> drivers/hid/i2c-hid/i2c-hid.c:1057:8: error: implicit declaration of function 'regulator_enable' [-Werror=implicit-function-declaration]
     ret = regulator_enable(ihid->pdata.supply);
           ^~~~~~~~~~~~~~~~
>> drivers/hid/i2c-hid/i2c-hid.c:1139:2: error: implicit declaration of function 'regulator_disable' [-Werror=implicit-function-declaration]
     regulator_disable(ihid->pdata.supply);
     ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/devm_regulator_get +1048 drivers/hid/i2c-hid/i2c-hid.c

  1042				goto err;
  1043			}
  1044		} else {
  1045			ihid->pdata = *platform_data;
  1046		}
  1047	
> 1048		ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd");
  1049	 	if (IS_ERR(ihid->pdata.supply)) {
  1050	 		ret = PTR_ERR(ihid->pdata.supply);
  1051	 		if (ret != -EPROBE_DEFER)
  1052	 			dev_err(&client->dev, "Failed to get regulator: %d\n",
  1053	 				ret);
  1054	 		return ret;
  1055	 	}
  1056	 
> 1057		ret = regulator_enable(ihid->pdata.supply);
  1058		if (ret < 0) {
  1059			dev_err(&client->dev, "Failed to enable regulator: %d\n",
  1060				ret);
  1061			goto err;
  1062		}
  1063		if (ihid->pdata.init_delay_ms)
  1064			msleep(ihid->pdata.init_delay_ms);
  1065	
  1066		i2c_set_clientdata(client, ihid);
  1067	
  1068		ihid->client = client;
  1069	
  1070		hidRegister = ihid->pdata.hid_descriptor_address;
  1071		ihid->wHIDDescRegister = cpu_to_le16(hidRegister);
  1072	
  1073		init_waitqueue_head(&ihid->wait);
  1074		mutex_init(&ihid->reset_lock);
  1075	
  1076		/* we need to allocate the command buffer without knowing the maximum
  1077		 * size of the reports. Let's use HID_MIN_BUFFER_SIZE, then we do the
  1078		 * real computation later. */
  1079		ret = i2c_hid_alloc_buffers(ihid, HID_MIN_BUFFER_SIZE);
  1080		if (ret < 0)
  1081			goto err_regulator;
  1082	
  1083		pm_runtime_get_noresume(&client->dev);
  1084		pm_runtime_set_active(&client->dev);
  1085		pm_runtime_enable(&client->dev);
  1086		device_enable_async_suspend(&client->dev);
  1087	
  1088		ret = i2c_hid_fetch_hid_descriptor(ihid);
  1089		if (ret < 0)
  1090			goto err_pm;
  1091	
  1092		ret = i2c_hid_init_irq(client);
  1093		if (ret < 0)
  1094			goto err_pm;
  1095	
  1096		hid = hid_allocate_device();
  1097		if (IS_ERR(hid)) {
  1098			ret = PTR_ERR(hid);
  1099			goto err_irq;
  1100		}
  1101	
  1102		ihid->hid = hid;
  1103	
  1104		hid->driver_data = client;
  1105		hid->ll_driver = &i2c_hid_ll_driver;
  1106		hid->dev.parent = &client->dev;
  1107		hid->bus = BUS_I2C;
  1108		hid->version = le16_to_cpu(ihid->hdesc.bcdVersion);
  1109		hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID);
  1110		hid->product = le16_to_cpu(ihid->hdesc.wProductID);
  1111	
  1112		snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
  1113			 client->name, hid->vendor, hid->product);
  1114		strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
  1115	
  1116		ihid->quirks = i2c_hid_lookup_quirk(hid->vendor, hid->product);
  1117	
  1118		ret = hid_add_device(hid);
  1119		if (ret) {
  1120			if (ret != -ENODEV)
  1121				hid_err(client, "can't add hid device: %d\n", ret);
  1122			goto err_mem_free;
  1123		}
  1124	
  1125		pm_runtime_put(&client->dev);
  1126		return 0;
  1127	
  1128	err_mem_free:
  1129		hid_destroy_device(hid);
  1130	
  1131	err_irq:
  1132		free_irq(client->irq, ihid);
  1133	
  1134	err_pm:
  1135		pm_runtime_put_noidle(&client->dev);
  1136		pm_runtime_disable(&client->dev);
  1137	
  1138	err_regulator:
> 1139		regulator_disable(ihid->pdata.supply);
  1140	
  1141	err:
  1142		i2c_hid_free_buffers(ihid);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux