[U-Boot] [PATCH v3] M28: Added pin name support in GPIO driver
Mike Frysinger
vapier at gentoo.org
Wed Nov 23 23:22:20 CET 2011
On Wednesday 23 November 2011 16:10:49 Robert Deliën wrote:
> This patch adds pin name support in the GPIO driver. With this patch
> applied, the gpio command supports pins to be addressed with friendly
> names.
this patch is mangled as well
> --- a/arch/blackfin/include/asm/gpio.h
> +++ b/arch/blackfin/include/asm/gpio.h
>
> /*
> - * Copyright 2006-2009 Analog Devices Inc.
> + * (C) Copyright 2006-2009
> + * Analog Devices Inc.
> *
> - * Licensed under the GPL-2 or later.
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> */
NAK: don't monkey with unrelated stuff
> --- a/common/cmd_gpio.c
> +++ b/common/cmd_gpio.c
>
> /*
> - * Control GPIO pins on the fly
> + * (C) Copyright 2008-2011
> + * Analog Devices Inc.
> *
> - * Copyright (c) 2008-2011 Analog Devices Inc.
> + * See file CREDITS for list of people who contributed to this
> + * project.
> *
> - * Licensed under the GPL-2 or later.
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> */
NAK: don't monkey with unrelated stuff
> if (argc != 3)
> - show_usage:
> - return cmd_usage(cmdtp);
> + goto show_usage;
> +
> str_cmd = argv[1];
> str_gpio = argv[2];
>
> @@ -56,9 +71,11 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc,
> char * const argv[]) }
>
> /* turn the gpio name into a gpio number */
> - gpio = name_to_gpio(str_gpio);
> - if (gpio < 0)
> - goto show_usage;
> + gpio = gpio_name_to_pin(str_gpio);
> + if (gpio < 0) {
> + printf("gpio: unknown pin %s\n", str_gpio);
> + return -1;
> + }
>
> /* check bank and pin number for validity */
> if (gpio_invalid(gpio)) {
> @@ -91,6 +108,8 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc,
> char * const argv[]) gpio_free(gpio);
>
> return value;
> +show_usage:
> + return cmd_usage(cmdtp);
> }
do not mix style and functional changes. i see no reason to change the code
flow here.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111123/d1c8ad69/attachment.pgp>
More information about the U-Boot
mailing list