Lines Matching +full:pd +full:- +full:node
1 // SPDX-License-Identifier: GPL-2.0-only
45 * declared under the device node, while surfacepro3_button.c only needs
46 * the ACPI companion node.
93 struct platform_device *pd; in surface3_button_device_create() local
100 gpio_keys_pdata = devm_kzalloc(&client->dev, in surface3_button_device_create()
105 return ERR_PTR(-ENOMEM); in surface3_button_device_create()
109 for (info = button_info; info->name; info++) { in surface3_button_device_create()
110 if (info->autorepeat != autorepeat) in surface3_button_device_create()
113 gpio = surface3_button_lookup_gpio(&client->dev, in surface3_button_device_create()
114 info->acpi_index); in surface3_button_device_create()
118 gpio_keys[n_buttons].type = info->event_type; in surface3_button_device_create()
119 gpio_keys[n_buttons].code = info->event_code; in surface3_button_device_create()
121 gpio_keys[n_buttons].active_low = info->active_low; in surface3_button_device_create()
122 gpio_keys[n_buttons].desc = info->name; in surface3_button_device_create()
123 gpio_keys[n_buttons].wakeup = info->wakeup; in surface3_button_device_create()
128 error = -ENODEV; in surface3_button_device_create()
132 gpio_keys_pdata->buttons = gpio_keys; in surface3_button_device_create()
133 gpio_keys_pdata->nbuttons = n_buttons; in surface3_button_device_create()
134 gpio_keys_pdata->rep = autorepeat; in surface3_button_device_create()
136 pd = platform_device_alloc("gpio-keys", PLATFORM_DEVID_AUTO); in surface3_button_device_create()
137 if (!pd) { in surface3_button_device_create()
138 error = -ENOMEM; in surface3_button_device_create()
142 error = platform_device_add_data(pd, gpio_keys_pdata, in surface3_button_device_create()
147 error = platform_device_add(pd); in surface3_button_device_create()
151 return pd; in surface3_button_device_create()
154 platform_device_put(pd); in surface3_button_device_create()
156 devm_kfree(&client->dev, gpio_keys_pdata); in surface3_button_device_create()
167 if (priv->children[i]) in surface3_button_remove()
168 platform_device_unregister(priv->children[i]); in surface3_button_remove()
184 struct device *dev = &client->dev; in surface3_button_probe()
186 struct platform_device *pd; in surface3_button_probe() local
190 if (strncmp(acpi_device_bid(ACPI_COMPANION(&client->dev)), in surface3_button_probe()
193 return -ENODEV; in surface3_button_probe()
203 return -ENOMEM; in surface3_button_probe()
208 pd = surface3_button_device_create(client, in surface3_button_probe()
211 if (IS_ERR(pd)) { in surface3_button_probe()
212 error = PTR_ERR(pd); in surface3_button_probe()
213 if (error != -ENODEV) { in surface3_button_probe()
220 priv->children[i] = pd; in surface3_button_probe()
223 if (!priv->children[0] && !priv->children[1]) in surface3_button_probe()
224 return -ENODEV; in surface3_button_probe()