u-boot/arch/arm/mach-uniphier/pinctrl-glue.c
Masahiro Yamada 0f4ec05bbb ARM: uniphier: replace <linux/err.h> with <linux/errno.h>
These files only need error number macros.  Actually, IS_ERR(),
PTR_ERR(), ERR_PTR(), etc. are not useful for U-Boot.  Avoid
unnecessary header includes.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-01-22 15:32:56 +09:00

32 lines
631 B
C

/*
* Copyright (C) 2016 Socionext Inc.
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <linux/errno.h>
#include <dm/device.h>
#include <dm/pinctrl.h>
#include <dm/uclass.h>
#include "init.h"
int uniphier_pin_init(const char *pinconfig_name)
{
struct udevice *pctldev, *config, *next;
int ret;
ret = uclass_first_device(UCLASS_PINCTRL, &pctldev);
if (ret)
return ret;
device_foreach_child_safe(config, next, pctldev) {
if (strcmp(config->name, pinconfig_name))
continue;
return pinctrl_generic_set_state(pctldev, config);
}
return -ENODEV;
}