@@ -688,7 +688,6 @@ static int lenovo_probe_tpkbd(struct hid_device *hdev)
sizeof(struct lenovo_drvdata_tpkbd),
GFP_KERNEL);
if (data_pointer == NULL) {
- hid_err(hdev, "Could not allocate memory for driver data\n");
ret = -ENOMEM;
goto err;
}
@@ -746,10 +745,9 @@ static int lenovo_probe_cptkbd(struct hid_device *hdev)
cptkbd_data = devm_kzalloc(&hdev->dev,
sizeof(*cptkbd_data),
GFP_KERNEL);
- if (cptkbd_data == NULL) {
- hid_err(hdev, "can't alloc keyboard descriptor\n");
+ if (!cptkbd_data)
return -ENOMEM;
- }
+
hid_set_drvdata(hdev, cptkbd_data);
/*