Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp950528ybi; Fri, 2 Aug 2019 07:00:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWA1IO38bpV7X5/SrcQXRCIpWfH+xc0/ej3/l/TVl+dGuetgPM5h75v1W03c4vpOq/0Jur X-Received: by 2002:a65:5043:: with SMTP id k3mr67887105pgo.406.1564754457934; Fri, 02 Aug 2019 07:00:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564754457; cv=none; d=google.com; s=arc-20160816; b=TljBs44VK23psRpEWBbkxbv+aDCklZHoDAAxtWJrq5xEeWuuE/a5f5+mPFLYWhc8P3 KtjWBHPifbvp0GUe/HAUNtA6ekmJyHiKCyaPVvR+F26gkM7pfK/DEWIGWLyJ49Vr79kS 8+ZW2T8AuL1G9H9gkPHYyUZW4XPgcsheRvT5S1XYmX/XG3Tf9PmD343dep26hhZfxhn7 Zv3fcCpwCXtN8XKfL9PvWr6h+INC21gsNPNrVuIdvTUiDPOyKAm5KDXt3NXFmOMCxFY6 3+hrekuCBs1VM8MhyTERiN/KI+ugWZW8+6DF5eCANuTaan521CgJkUb/dzseS/8yxXCg 42bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=6svSKUB8W/2vAHAY5YVCqR8+83bHvMbbXUyJ8GuWHhs=; b=SdcL0j7bIpR+o5fSGGpkCmTAOVQST0vjprEY2+aRO1eEz2cgximQjZdMURT8Uh4EkX Kr10Q9paUH7Sob8XEUr/2F/SYUJ2nMsjNq6jjO7VJQcvGm0yKa6OcYaZG2+qWg+chgOS ThXgJsrtYJXL2i3QqTRLXAFTuen1nh0DMvx41hUS+Nvmy607A/cP7mXSkIhSFtdUvzmC t3Pw2xJPNMkqKIEHx4wAltZpVmn3bbIO3db1/fwBsIL0sXoTsafzhvIy5bNkw2OkYicz MCVVKKkMrQhVJ2ZDRhQKoB1lLGgg+AOJwtOSDG+jCggp1YiMj4hoDCqbSCvHcTGofZrV Nmxg== 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 23si37624192pfi.265.2019.08.02.07.00.42; Fri, 02 Aug 2019 07:00:57 -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 S2392318AbfHBLUN (ORCPT + 99 others); Fri, 2 Aug 2019 07:20:13 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:33004 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729311AbfHBLUN (ORCPT ); Fri, 2 Aug 2019 07:20:13 -0400 Received: by mail-qt1-f194.google.com with SMTP id r6so69212912qtt.0; Fri, 02 Aug 2019 04:20:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6svSKUB8W/2vAHAY5YVCqR8+83bHvMbbXUyJ8GuWHhs=; b=Vl32TDMoJGrn//dSjae8BtiiQXbK1GVk/KIbMF3jNGRWYACaHiYHpsZfap3j31W4oW 1BA2ejxnYg2JRRwI0gLIoyFsHc67h+13SAY00sQX8udn4tjIu/HINcaKSY81kZga1S8t Z96q1ZqfPotvz1gM8G2zfUCt8ExscRW1F+h0PNErKwUa17Di67EyRfK3i11QcIwrMbg9 UF4CXKQ8dj4VEjWIcB3WleofB9bgdF13cUL1B7ycOfdu2iwYzk1KZqn4GgwyAXd3pEqp ZyJk+a63FwkjXR3xmi2n7mIjzg1WtgsxYAO6/htVZuth3A95S1NsrU6cwDkhpCwGjOfc 17OQ== X-Gm-Message-State: APjAAAUdUndDAUq0W8zUuGURS4swB4p+GxBZ8r9A6fPJkOw5lclCpg3H rr+b//tj0sGqReIzV6FkE2Lpr4My2TzBF+YvrTk= X-Received: by 2002:aed:3e7c:: with SMTP id m57mr95077214qtf.204.1564744811845; Fri, 02 Aug 2019 04:20:11 -0700 (PDT) MIME-Version: 1.0 References: <20190731195713.3150463-1-arnd@arndb.de> <20190731195713.3150463-6-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Fri, 2 Aug 2019 13:19:55 +0200 Message-ID: Subject: Re: [PATCH 05/14] gpio: lpc32xx: allow building on non-lpc32xx targets To: Bartosz Golaszewski Cc: soc@kernel.org, arm-soc , Vladimir Zapolskiy , Sylvain Lemieux , Russell King , Gregory Clement , Linus Walleij , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio , netdev , linux-serial@vger.kernel.org, USB list , LINUXWATCHDOG , Lee Jones , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 2, 2019 at 9:10 AM Bartosz Golaszewski wrote: > > -#include > > -#include > > +#define _GPREG(x) (x) > > What purpose does this macro serve? > > > > > #define LPC32XX_GPIO_P3_INP_STATE _GPREG(0x000) > > #define LPC32XX_GPIO_P3_OUTP_SET _GPREG(0x004) In the existing code base, this macro converts a register offset to an __iomem pointer for a gpio register. I changed the definition of the macro here to keep the number of changes down, but I it's just as easy to remove it if you prefer. > > @@ -167,14 +166,26 @@ struct lpc32xx_gpio_chip { > > struct gpio_regs *gpio_grp; > > }; > > > > +void __iomem *gpio_reg_base; > > Any reason why this can't be made part of struct lpc32xx_gpio_chip? It could be, but it's the same for each instance, and not known until probe() time, so the same pointer would need to be copied into each instance that is otherwise read-only. Let me know if you'd prefer me to rework these two things or leave them as they are. > > +static inline u32 gpreg_read(unsigned long offset) > > Here and elsewhere: could you please keep the lpc32xx_gpio prefix for > all symbols? Sure. Arnd