Input: gpio_keys_polled - allow specifying name of input device

Instead of hardcoding the input name to the driver name
('gpio-keys-polled'), allow specifying the name of the device via
"label" property. If the property is not present (nor name is set in
board-supplied platform data), we'll default to the old name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Enrico Weigelt, metux IT consult and committed by
Dmitry Torokhov
593fdd4f 17b92927

+3 -1
+3 -1
drivers/input/keyboard/gpio_keys_polled.c
··· 168 168 pdata->rep = device_property_present(dev, "autorepeat"); 169 169 device_property_read_u32(dev, "poll-interval", &pdata->poll_interval); 170 170 171 + device_property_read_string(dev, "label", &pdata->name); 172 + 171 173 device_for_each_child_node(dev, child) { 172 174 if (fwnode_property_read_u32(child, "linux,code", 173 175 &button->code)) { ··· 272 270 273 271 input = poll_dev->input; 274 272 275 - input->name = pdev->name; 273 + input->name = pdata->name ?: pdev->name; 276 274 input->phys = DRV_NAME"/input0"; 277 275 278 276 input->id.bustype = BUS_HOST;