1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <device/gpio.h>
8 const struct gpio_operations
*dev_get_gpio_ops(struct device
*dev
)
11 printk(BIOS_ERR
, "Could not get gpio operations, device is NULL.");
13 } else if (!dev
->ops
) {
14 printk(BIOS_ERR
, "Could not get gpio operations, dev->ops is NULL.");
16 } else if (!dev
->ops
->ops_gpio
) {
17 printk(BIOS_ERR
, "Could not get gpio operations, ops_gpio is NULL.");
21 return dev
->ops
->ops_gpio
;