[PATCH 2/4] HID: lamparray: raise log level of fatal probe errors

From: Cristian Mazzotta

Date: Wed Sep 09 2026 - 14:21:56 EST


The failure paths in lamparray_read_attributes_report() and
lamparray_get_lamp_attributes() use hid_dbg(), so on a device that
cannot be driven the driver declines to register with no output unless
dynamic debug is enabled for the module.

Use hid_warn() for these, since they leave the device without LED
support and the reason is useful to anyone diagnosing why a LampArray
device did not appear under /sys/class/leds.

Signed-off-by: Cristian Mazzotta <cmmazzo@xxxxxxxxxx>
---
drivers/hid/hid-lamparray.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/hid/hid-lamparray.c b/drivers/hid/hid-lamparray.c
index f169929aecd6..70c596f292a2 100644
--- a/drivers/hid/hid-lamparray.c
+++ b/drivers/hid/hid-lamparray.c
@@ -169,19 +169,19 @@ static int lamparray_read_attributes_report(struct lamparray_device *ldev)
size_t len;

if (!ldev->lamp_count.field) {
- hid_dbg(hdev, "No LampCount field found\n");
+ hid_warn(hdev, "No LampCount field found\n");
return -ENODEV;
}

if (!ldev->lamparray_kind.field) {
- hid_dbg(hdev, "No LampArrayKind field found\n");
+ hid_warn(hdev, "No LampArrayKind field found\n");
return -ENODEV;
}

report = ldev->lamp_count.field->report;

if (!report) {
- hid_dbg(hdev, "LampCount field has no report\n");
+ hid_warn(hdev, "LampCount field has no report\n");
return -ENODEV;
}

@@ -196,7 +196,7 @@ static int lamparray_read_attributes_report(struct lamparray_device *ldev)
ret = hid_hw_raw_request(hdev, report->id, buf, len,
HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
if (ret < 0) {
- hid_dbg(hdev, "Failed to get LampCount value from device: %d\n", ret);
+ hid_warn(hdev, "Failed to get LampCount value from device: %d\n", ret);
goto out;
}

@@ -204,7 +204,7 @@ static int lamparray_read_attributes_report(struct lamparray_device *ldev)

ldev->lamp_count_value = get_field_value(&ldev->lamp_count);
if (!ldev->lamp_count_value) {
- hid_dbg(hdev, "LampCount is 0 (invalid)\n");
+ hid_warn(hdev, "LampCount is 0 (invalid)\n");
ret = -EINVAL;
goto out;
}
@@ -415,7 +415,7 @@ static int lamparray_get_lamp_attributes(struct lamparray_device *ldev)
ret = hid_hw_raw_request(hdev, report->id, buf, len,
HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
if (ret < 0) {
- hid_dbg(hdev, "Failed to read LampAttributesResponseReport: %d\n", ret);
+ hid_warn(hdev, "Failed to read LampAttributesResponseReport: %d\n", ret);
goto out;
}

@@ -427,7 +427,7 @@ static int lamparray_get_lamp_attributes(struct lamparray_device *ldev)
ldev->max_brightness = get_field_value_as_u8(&ldev->color_levels.intensity);

if (!ldev->max_r || !ldev->max_g || !ldev->max_b || !ldev->max_brightness) {
- hid_dbg(hdev, "LampArray device has no color levels\n");
+ hid_warn(hdev, "LampArray device has no color levels\n");
ret = -EINVAL;
goto out;
}
--
2.55.0