Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4874967ybb; Tue, 24 Mar 2020 06:58:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt06bsWQLAJRd69bvWWHlpM70xfd8N7nFLowwHoAfUTRIPIF54AtpG5ZO8ZxAx1qqhHj53c X-Received: by 2002:a9d:4d0c:: with SMTP id n12mr22864667otf.83.1585058281399; Tue, 24 Mar 2020 06:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585058281; cv=none; d=google.com; s=arc-20160816; b=LXU9X50pL2PIKjFk/kROwYPblByH30wrcecS8kV5S3mDGm9boP3rBCT/XycFfzmeCM EQPTlfQZZcuzrD1rGAiWOT7JtSgK7HvdfryNCTbosXtdpMHAMEdQQ4cX4H2nLcuZ/UBp GBoFcM4006VYduwk+toyflYlujawFDDeWqNNei0O9qed4Wp/i4Oh7TLC25vzgtgsrgy/ DqTuK5X4O/3oLsqlX7smcGUJtE7ZXLyW4VpvWXMtOq1OWkuuQTmisSzDwZKHhb6t9nta WZ+Yo28Dtx88hTD8ewsflPbLOLDL3CbSsOIIfrrOe2HW2Dl3+6UQGsCUcPI4NAVdZSHx bDdA== 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=lxZBuo/Gu5fk9Cm6NXAXIODgsRVuePqjhjCDMhENP9c=; b=NMT62CHZIJWpJHRZTujsoC/D1dEBFK4E/zFC4h20PtrbcQyqBbMayzTaq+t7tN9K7O 4FIyw6WFjdeUjE0VUyDu6e5GHd7LRBizXm649UlI65jyI3HXNFR1N4R/wBNdPPrRbklO 4VciPOajA/Qk288TSt2kaDnQr2eUWwePvuGvQNzxzLMPwtW1yruoFiYBx2o5Cz8p0Xd9 b+h3pGZ6z2JjD0whav19vJwKPP4rnvGuMGp2c7d78zNoIArRDi9JCoEsaNZgUKHFs0xg E8NYD/iQH0pG6Wm7bSur1uU7nK9waWTfs6Csn7Fmf475gSgY8Pt9+ICkOWiu3yBJVGU2 eD7Q== 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 j22si8780376otk.107.2020.03.24.06.57.49; Tue, 24 Mar 2020 06:58:01 -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 S1728224AbgCXN5X (ORCPT + 99 others); Tue, 24 Mar 2020 09:57:23 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:37858 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728107AbgCXN5W (ORCPT ); Tue, 24 Mar 2020 09:57:22 -0400 Received: from ramsan ([84.195.182.253]) by michel.telenet-ops.be with bizsmtp id JDwu2200M5USYZQ06Dwu4g; Tue, 24 Mar 2020 14:57:19 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1jGk34-0006Oc-Ga; 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-0001kW-Ey; 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 , linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 1/8] ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro Date: Tue, 24 Mar 2020 14:56:46 +0100 Message-Id: <20200324135653.6676-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324135328.5796-1-geert+renesas@glider.be> References: <20200324135328.5796-1-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org impd1_probe() 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: linux-arm-kernel@lists.infradead.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. --- arch/arm/mach-integrator/impd1.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 1ecbea5331d6ed8b..6f875ded841924d8 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c @@ -410,13 +410,10 @@ static int __ref impd1_probe(struct lm_device *dev) * 5 = Key lower right */ /* We need the two MMCI GPIO entries */ - lookup->table[0].chip_label = chipname; - lookup->table[0].chip_hwnum = 3; - lookup->table[0].con_id = "wp"; - lookup->table[1].chip_label = chipname; - lookup->table[1].chip_hwnum = 4; - lookup->table[1].con_id = "cd"; - lookup->table[1].flags = GPIO_ACTIVE_LOW; + lookup->table[0] = (struct gpiod_lookup) + GPIO_LOOKUP(chipname, 3, "wp", 0); + lookup->table[1] = (struct gpiod_lookup) + GPIO_LOOKUP(chipname, 4, "cd", GPIO_ACTIVE_LOW); gpiod_add_lookup_table(lookup); } -- 2.17.1