[gpio:gpio-descriptors-spi 9/12] drivers/gpio/gpiolib-acpi.c:887: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:   0150316e407fca7a2992be71c73054e4d1e9d1e4
commit: e5aa5a707ab92168b3cdedc8789bb9e5d64fcf28 [9/12] gpio: Pass a flag to gpiochip_request_own_desc()
config: i386-randconfig-x019-201849 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout e5aa5a707ab92168b3cdedc8789bb9e5d64fcf28
        # 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:887:11: error: too many arguments to function 'gpiochip_request_own_desc'
       desc = gpiochip_request_own_desc(chip, pin, label,
              ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpio/gpiolib-acpi.c:12:0:
   include/linux/gpio/driver.h:613:19: note: declared here
    struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpio/gpiolib-acpi.c:885:8: warning: unused variable 'err' [-Wunused-variable]
       int err;
           ^~~

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

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

---
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