04c3b5a016
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: Idd78271f2158bdc29ce9ac8d81f46ad8cbe84c5e Reviewed-on: https://review.coreboot.org/c/coreboot/+/68205 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
22 lines
582 B
C
22 lines
582 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <console/console.h>
|
|
#include <device/device.h>
|
|
#include <device/gpio.h>
|
|
#include <stddef.h>
|
|
|
|
const struct gpio_operations *dev_get_gpio_ops(struct device *dev)
|
|
{
|
|
if (!dev) {
|
|
printk(BIOS_ERR, "Could not get gpio operations, device is NULL.");
|
|
return NULL;
|
|
} else if (!dev->ops) {
|
|
printk(BIOS_ERR, "Could not get gpio operations, dev->ops is NULL.");
|
|
return NULL;
|
|
} else if (!dev->ops->ops_gpio) {
|
|
printk(BIOS_ERR, "Could not get gpio operations, ops_gpio is NULL.");
|
|
return NULL;
|
|
}
|
|
|
|
return dev->ops->ops_gpio;
|
|
}
|