Skip to content

Commit a966816

Browse files
Dan CarpenterBenjamin Tissoires
authored andcommitted
HID: hid-steam: remove pointless error message
This error message doesn't really add any information. If modprobe fails then the user will already know what the error code is. In the case of kmalloc() it's a style violation to print an error message for that because kmalloc has it's own better error messages built in. Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Vicki Pfau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent fef018d commit a966816

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/hid/hid-steam.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,10 +1109,9 @@ static int steam_probe(struct hid_device *hdev,
11091109
return hid_hw_start(hdev, HID_CONNECT_DEFAULT);
11101110

11111111
steam = devm_kzalloc(&hdev->dev, sizeof(*steam), GFP_KERNEL);
1112-
if (!steam) {
1113-
ret = -ENOMEM;
1114-
goto steam_alloc_fail;
1115-
}
1112+
if (!steam)
1113+
return -ENOMEM;
1114+
11161115
steam->hdev = hdev;
11171116
hid_set_drvdata(hdev, steam);
11181117
spin_lock_init(&steam->lock);
@@ -1179,9 +1178,6 @@ static int steam_probe(struct hid_device *hdev,
11791178
cancel_work_sync(&steam->work_connect);
11801179
cancel_delayed_work_sync(&steam->mode_switch);
11811180
cancel_work_sync(&steam->rumble_work);
1182-
steam_alloc_fail:
1183-
hid_err(hdev, "%s: failed with error %d\n",
1184-
__func__, ret);
11851181
return ret;
11861182
}
11871183

0 commit comments

Comments
 (0)