Skip to contentSkip to conversation

hid:Add warning message if sysfs group is not created for passed kobject in the function, mt_probe

PATCH Benjamin Tissoires 2 participants 2 messages Feb 5, 2016 1 message not in the archive HID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Benjamin Tissoires

author Reviewed-by
#1 lore raw

Hi Nick,

Quoted 14 lines · Nicholas Krause

This adds a warning message stating that the sysfs group was not able to be created for the passed hid_device structure pointer with dev_warn.

---
 drivers/hid/hid-multitouch.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-multitouch.c +0 -0
index 296d499..b2b2451 100644

drivers/hid/hid-multitouch.c static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) · line 1137

Quoted 5 lines
drivers/hid/hid-multitouch.c +2 -0
@@ -1133,6 +1133,8 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		return ret;
 
 	ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group);
+	if (ret)
+		dev_warn(&hdev->dev, "Cannot allocate sysfs group for %s\n", hdev->name);

Just nitpicking here. Checkpatch.pl complains about a line over 80 characters here. Could you (or maybe just Jiri) fix that?

Otherwise:

Cheers,
Benjamin

Quoted 6 lines
drivers/hid/hid-multitouch.c +0 -0
 	mt_set_maxcontacts(hdev);
 	mt_set_input_mode(hdev);
Signature · 1 line
2.5.0
maintainer
#2 lore raw
Quoted 23 lines · Benjamin Tissoires
Quoted 14 lines

This adds a warning message stating that the sysfs group was not able to be created for the passed hid_device structure pointer with dev_warn.

---
 drivers/hid/hid-multitouch.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-multitouch.c +0 -0
index 296d499..b2b2451 100644

drivers/hid/hid-multitouch.c static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) · line 1137

Quoted 5 lines
drivers/hid/hid-multitouch.c +2 -0
@@ -1133,6 +1133,8 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		return ret;
 
 	ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group);
+	if (ret)
+		dev_warn(&hdev->dev, "Cannot allocate sysfs group for %s\n", hdev->name);

Just nitpicking here. Checkpatch.pl complains about a line over 80 characters here. Could you (or maybe just Jiri) fix that?

Quoted 2 lines

Otherwise:

Thanks. I've reformatted the source (and also changelog a bit) and applied.

Signature · 2 lines
Jiri Kosina
SUSE Labs