From 7b33e7843bb3a9851777a6ae78d5164ce6a533ba Mon Sep 17 00:00:00 2001 From: krayushkin Date: Fri, 11 Oct 2013 10:54:05 -0700 Subject: [PATCH] Fix sysfs exported gpio name (example "gpio254") Accoding to Documentation/gpio.txt GPIO signals have paths like /sys/class/gpio/gpio42/ (for GPIO #42). Existing version break compatability with program where used this interface. For example avrdude (avr programmer, module linuxgpio) work ok with this change (tested). --- drivers/gpio/gpio-sunxi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-sunxi.c b/drivers/gpio/gpio-sunxi.c index 6e86142eebd275..7ae7402d4f20e6 100644 --- a/drivers/gpio/gpio-sunxi.c +++ b/drivers/gpio/gpio-sunxi.c @@ -182,11 +182,9 @@ static int sunxi_gpio_request(struct gpio_chip *chip, unsigned offset) if ((offset > chip->ngpio - 1) || (offset < 0)) return -EINVAL; - /* Set sysfs exported gpio name (example "gpio254_ph20") */ - sprintf((char *)(chip->names[offset]), "gpio%d_p%c%d", - offset+chip->base, - 'a'+sgpio->data[offset].info.port-1, - sgpio->data[offset].info.port_num); + /* Set sysfs exported gpio name (example "gpio254") */ + sprintf((char *)(chip->names[offset]), "gpio%d", + offset+chip->base); sgpio->data[offset].gpio_handler = gpio_request_ex("gpio_para", sgpio->data[offset].pin_name);