Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4874841ybb; Tue, 24 Mar 2020 06:57:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtpynI9Xo9XQX6DKdaKDyLvBcB75vZB9rcKRFDrSAqkgZBKXXu/0iYQX+HA/+nPPWACTbjV X-Received: by 2002:aca:4a86:: with SMTP id x128mr3560730oia.29.1585058274093; Tue, 24 Mar 2020 06:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585058274; cv=none; d=google.com; s=arc-20160816; b=fJb0LPHD+NuzpTFxG8fcj0pAVmu6H6jYq2mbPzHmsj9gC9ZRYI/RAQT3w8bbIfgehv 1aO/1RewS21rv0T7nC5sXmBWIha/gk1Tu34ZfDIl6ZFbWB5Iz8JMKSK70XEZWyuDMvUx vQ+XPBlLWsClXZjmA9u+adIqzErc0pEwTgsk8qzjDLILB0Xl8byoBfJokBf23Kp4r8Jc YXhcd73wadx90vJNUUZqZJoeqUH6HObk7a/feLFca0mP29yIW2LefHL8jBidlqNIzT7j U8CFiwWvXpCsMRCjmonjzBDhybt76zsMbwa6RLfkna7SxHw0hisC8EDFoOZqESXUbtOD e+Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=ZtuqANO+VIxMM4Oi29QEw94e98E8IH1RBotqZcuTkco=; b=yuO2fmSwjsvB7YwNoJf2SIs05yRvp/EOeBOFvgBMQ88Z6JfdNCBTLM87EHRJ6Ral2W VaI1Z8+NrP0rzsQYEXcuCGYz/T01DQl8ontJzOtbJDfqGXVvhH4gNfgttEqmmfTlevH2 8g9oz8Ib7nyEzGxufGLc1LqAvrnFbA6qq7CpKpGOzk6Vp94UuHCDVyMvBH4Gpzc/mghn kWN8A13v+8ccW7q9hjnflri9Y+HWZNsAT56+jje9/NVqraY7VfZvXGRte1C3k3a5kMId 0ErzyWt4tn6ZPbmS3K5vQM/KgijZiNfvJ7cPiaupwuzKgDi9ba1FW84PMzULaa1XZiyw /1XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si1669603oih.157.2020.03.24.06.57.41; Tue, 24 Mar 2020 06:57:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728009AbgCXN5S (ORCPT + 99 others); Tue, 24 Mar 2020 09:57:18 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:36950 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727885AbgCXN5J (ORCPT ); Tue, 24 Mar 2020 09:57:09 -0400 Received: from ramsan ([84.195.182.253]) by laurent.telenet-ops.be with bizsmtp id JDwu2200E5USYZQ01Dwult; Tue, 24 Mar 2020 14:57:07 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1jGk34-0006Oe-He; Tue, 24 Mar 2020 14:56:54 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1jGk34-0001kY-Ft; Tue, 24 Mar 2020 14:56:54 +0100 From: Geert Uytterhoeven To: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Harish Jenny K N , Eugeniu Rosca Cc: Alexander Graf , Peter Maydell , Paolo Bonzini , Phil Reid , Marc Zyngier , Christoffer Dall , Magnus Damm , Rob Herring , Mark Rutland , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, Geert Uytterhoeven , Jean Delvare , linux-i2c@vger.kernel.org Subject: [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro Date: Tue, 24 Mar 2020 14:56:47 +0100 Message-Id: <20200324135653.6676-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324135653.6676-1-geert+renesas@glider.be> References: <20200324135328.5796-1-geert+renesas@glider.be> <20200324135653.6676-1-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org i801_add_mux() fills in the GPIO lookup table by manually populating an array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper macro instead, to relax a dependency on the gpiod_lookup structure's member names. Signed-off-by: Geert Uytterhoeven Cc: Jean Delvare Cc: linux-i2c@vger.kernel.org --- While this patch is a dependency for "[PATCH v6 4/8] gpiolib: Add support for GPIO lookup by line name", it can be applied independently. But an Acked-by would be nice, too. Cover letter and full series at https://lore.kernel.org/r/20200324135328.5796-1-geert+renesas@glider.be/ v6: - New. --- drivers/i2c/busses/i2c-i801.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index ca4f096fef749302..8e64a71bea684cc7 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1444,9 +1444,9 @@ static int i801_add_mux(struct i801_priv *priv) return -ENOMEM; lookup->dev_id = "i2c-mux-gpio"; for (i = 0; i < mux_config->n_gpios; i++) { - lookup->table[i].chip_label = mux_config->gpio_chip; - lookup->table[i].chip_hwnum = mux_config->gpios[i]; - lookup->table[i].con_id = "mux"; + lookup->table[i] = (struct gpiod_lookup) + GPIO_LOOKUP(mux_config->gpio_chip, + mux_config->gpios[i], "mux", 0); } gpiod_add_lookup_table(lookup); priv->lookup = lookup; -- 2.17.1