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