/* * Creates gpio-keys-polled device for the restart key. * * Note that it needs to be called first, before geode_create_leds(), * because it registers gpiochip software node used by both gpio-keys and * leds-gpio devices.
*/ int __init geode_create_restart_key(unsignedint pin)
{ struct platform_device_info keys_info = {
.name = "gpio-keys-polled",
.id = 1,
}; struct platform_device *pd; int err;
if (n_leds > MAX_LEDS) {
pr_err("%s: too many LEDs\n", __func__); return -EINVAL;
}
swnodes = kcalloc(n_leds, sizeof(*swnodes), GFP_KERNEL); if (!swnodes) return -ENOMEM;
/* * Each LED is represented by 3 properties: "gpios", * "linux,default-trigger", and am empty terminator.
*/
props = kcalloc(n_leds * 3, sizeof(*props), GFP_KERNEL); if (!props) {
err = -ENOMEM; goto err_free_swnodes;
}
group[0] = &geode_gpio_leds_node; for (i = 0; i < n_leds; i++) {
node_name = kasprintf(GFP_KERNEL, "%s:%d", label, i); if (!node_name) {
err = -ENOMEM; goto err_free_names;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.