[gpio:gpio-descriptors-spi 3/4] drivers//gpio/gpiolib-acpi.c:886:11: error: too many arguments to function 'gpiochip_request_own_desc'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-spi
head:   0ea1828d74e37216988a9e46cfd3db602607eba8
commit: a8e37cfca60f3671f1134335b392019c2d233c6a [3/4] gpio: Pass a flag to gpiochip_request_own_desc()
config: i386-randconfig-x077-201835 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        git checkout a8e37cfca60f3671f1134335b392019c2d233c6a
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers//gpio/gpiolib-acpi.c: In function 'acpi_gpio_adr_space_handler':
>> drivers//gpio/gpiolib-acpi.c:886:11: error: too many arguments to function 'gpiochip_request_own_desc'
       desc = gpiochip_request_own_desc(chip, pin, label,
              ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/gpio.h:13:0,
                    from include/linux/gpio.h:62,
                    from drivers//gpio/gpiolib-acpi.c:14:
   include/linux/gpio/driver.h:573:19: note: declared here
    struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers//gpio/gpiolib-acpi.c:884:8: warning: unused variable 'err' [-Wunused-variable]
       int err;
           ^~~

vim +/gpiochip_request_own_desc +886 drivers//gpio/gpiolib-acpi.c

   812	
   813	static acpi_status
   814	acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
   815				    u32 bits, u64 *value, void *handler_context,
   816				    void *region_context)
   817	{
   818		struct acpi_gpio_chip *achip = region_context;
   819		struct gpio_chip *chip = achip->chip;
   820		struct acpi_resource_gpio *agpio;
   821		struct acpi_resource *ares;
   822		int pin_index = (int)address;
   823		acpi_status status;
   824		int length;
   825		int i;
   826	
   827		status = acpi_buffer_to_resource(achip->conn_info.connection,
   828						 achip->conn_info.length, &ares);
   829		if (ACPI_FAILURE(status))
   830			return status;
   831	
   832		if (WARN_ON(ares->type != ACPI_RESOURCE_TYPE_GPIO)) {
   833			ACPI_FREE(ares);
   834			return AE_BAD_PARAMETER;
   835		}
   836	
   837		agpio = &ares->data.gpio;
   838	
   839		if (WARN_ON(agpio->io_restriction == ACPI_IO_RESTRICT_INPUT &&
   840		    function == ACPI_WRITE)) {
   841			ACPI_FREE(ares);
   842			return AE_BAD_PARAMETER;
   843		}
   844	
   845		length = min(agpio->pin_table_length, (u16)(pin_index + bits));
   846		for (i = pin_index; i < length; ++i) {
   847			int pin = agpio->pin_table[i];
   848			struct acpi_gpio_connection *conn;
   849			struct gpio_desc *desc;
   850			bool found;
   851	
   852			mutex_lock(&achip->conn_lock);
   853	
   854			found = false;
   855			list_for_each_entry(conn, &achip->conns, node) {
   856				if (conn->pin == pin) {
   857					found = true;
   858					desc = conn->desc;
   859					break;
   860				}
   861			}
   862	
   863			/*
   864			 * The same GPIO can be shared between operation region and
   865			 * event but only if the access here is ACPI_READ. In that
   866			 * case we "borrow" the event GPIO instead.
   867			 */
   868			if (!found && agpio->sharable == ACPI_SHARED &&
   869			     function == ACPI_READ) {
   870				struct acpi_gpio_event *event;
   871	
   872				list_for_each_entry(event, &achip->events, node) {
   873					if (event->pin == pin) {
   874						desc = event->desc;
   875						found = true;
   876						break;
   877					}
   878				}
   879			}
   880	
   881			if (!found) {
   882				enum gpiod_flags flags = acpi_gpio_to_gpiod_flags(agpio);
   883				const char *label = "ACPI:OpRegion";
   884				int err;
   885	
 > 886				desc = gpiochip_request_own_desc(chip, pin, label,
   887								 0, flags);
   888				if (IS_ERR(desc)) {
   889					status = AE_ERROR;
   890					mutex_unlock(&achip->conn_lock);
   891					goto out;
   892				}
   893	
   894				conn = kzalloc(sizeof(*conn), GFP_KERNEL);
   895				if (!conn) {
   896					status = AE_NO_MEMORY;
   897					gpiochip_free_own_desc(desc);
   898					mutex_unlock(&achip->conn_lock);
   899					goto out;
   900				}
   901	
   902				conn->pin = pin;
   903				conn->desc = desc;
   904				list_add_tail(&conn->node, &achip->conns);
   905			}
   906	
   907			mutex_unlock(&achip->conn_lock);
   908	
   909			if (function == ACPI_WRITE)
   910				gpiod_set_raw_value_cansleep(desc,
   911							     !!((1 << i) & *value));
   912			else
   913				*value |= (u64)gpiod_get_raw_value_cansleep(desc) << i;
   914		}
   915	
   916	out:
   917		ACPI_FREE(ares);
   918		return status;
   919	}
   920	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux