Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2468461ybh; Mon, 5 Aug 2019 01:28:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz24wcMjg8alnRnyXSSZeNbawcFEMTwHcpOiZGOyIwyBIhu5+nOHUKfnsMfVYalUmmg1hlQ X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr144742082plb.3.1564993731534; Mon, 05 Aug 2019 01:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564993731; cv=none; d=google.com; s=arc-20160816; b=dc27qgYcXA/PIqoyRJHl/+InnzDmZHbbBoqszmpkZKmUxlE9rpBB0V1KZsmcEwZxys 5y/io4ffEQThcp8RoLgXHLWnpWn8TgvKTqrsLNq8krOLG6u+8MjotwMPjomQcP8H5Q2C wDFr3w/+pWHhOIK/7bnHwRkfqURu1vFTxjN4E+KWVfRt+cdiKCzAZBZXHkCInLe8KaBR aLkVMu6LwSsYpq5RmBmM1ooQaJK8MjODsZf2Cl4YlMiVO0FYP6YkGK+D7uJaxSo2OrKL vajZhY0/sVDaiA7qYwuTMG2TeKJR9GxotBG0cetUfwLTLhrS7liNm64KIRiPAiCW7q5s /lhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qvG85uu+23wc3aOz56jKz9zl98RKrlFXnI9v0RdgYHY=; b=Ey3a5vvZAi8tgRe/2U8AXbUjMd4rcIYjFmidzIiUyg83WE5tN5aGwniQMB/LH5qgna nfkH9Q79u3jZTASF6z7Z2D5oPzA2y8Pf2/MPCahCY5cn7Mlwbu+WBTQR9SV+UID7ogFL rbH6j5bNt1sI+TVV27ypvEu/sIYU2ArFiIXQeLmVqy6HH15ULctWh+CoYCN49dr44fqG Xr8MAhsIBUPw1ta0Y7djkj3qam5k7RjsLEFRUnqUuTFnPSdF+eRIfdw6rXjiz1Gm68Jp iE5MDhDHKnhXSFnt/6Pkgx7JOCPISFyOnR6B6eqyzqFjhed2zwJbCLawlP+qi8aYZp5f nnRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=gn0LHf8E; 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 b21si42400904plz.21.2019.08.05.01.28.35; Mon, 05 Aug 2019 01:28:51 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=gn0LHf8E; 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 S1727791AbfHEI2A (ORCPT + 99 others); Mon, 5 Aug 2019 04:28:00 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:44051 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbfHEI2A (ORCPT ); Mon, 5 Aug 2019 04:28:00 -0400 Received: by mail-ot1-f68.google.com with SMTP id b7so34258451otl.11 for ; Mon, 05 Aug 2019 01:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qvG85uu+23wc3aOz56jKz9zl98RKrlFXnI9v0RdgYHY=; b=gn0LHf8ENoBGwjVAUPWk1trAn5THo247jg8e6zjlOG+W0AiNseHCflLSx/XH7Kcfy9 2wSOMmbwOPfMbBjkX6M2RQupJ/NbQ7i1OeZV4x0b7UaMTogOPcjGAh2WD4/Wzn3oFz+S s68do0KW/i5W4PVQKdwoTVYuoajMggDI1ujveZBBQeM1XkbfxbcpVORGDNzhN6D90l0s nchBa36BsovaPAw4h8M0gY9GSFJmJ6RPIM5M8O2TBp8svyqdG+/Z77FGfO1gxNobnwjE Hl6bo1835l7C2TEp1ARt072yPf+OHySWwJSl6kUR7uAp3M2jEwLs21KSIEzQgcwZEeFx EIwg== 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:content-transfer-encoding; bh=qvG85uu+23wc3aOz56jKz9zl98RKrlFXnI9v0RdgYHY=; b=Rhc+UHSF0C27XeWe3giWzoUcq4eJ80lblx8P/VoBggplGO6RabXupQw+hcj7MI1A/u kDNAhClg0kJC62MD0m9hmiqKzXLRFF8L1DR5/NnO2iNfQLwX99zTMOkuojIVJpgqGEVD xxaKYJoh30xeFzeJwyat2x/N2BSZGXdkH3UmDLepKGaaXOz18pbOeSufUzxvuRSUo+0p h9Gey1chg/6WMX+6TbTvnRFYA3Bye7mdl/6qUMWApEip2DENzLfu2E/PE8lipOhsuI31 1gMenfPPHZU7ud7ImRSOw+hdi0sSxICPgnJIBlwGc9mAqj88dZvVFCpXqbUSP41PGTwr 55tw== X-Gm-Message-State: APjAAAVusPIwRLuQUJv1fJKVqpoGmmdPEjZ2leWiQ5SGNi0JmlI2z/35 PtszC3vUQtapzJ3vXIypk9Rk7meUn2N206W0TUncKA== X-Received: by 2002:a9d:2969:: with SMTP id d96mr115002880otb.85.1564993679131; Mon, 05 Aug 2019 01:27:59 -0700 (PDT) MIME-Version: 1.0 References: <20190731195713.3150463-1-arnd@arndb.de> <20190731195713.3150463-6-arnd@arndb.de> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 5 Aug 2019 10:27:48 +0200 Message-ID: Subject: Re: [PATCH 05/14] gpio: lpc32xx: allow building on non-lpc32xx targets To: Arnd Bergmann 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" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pt., 2 sie 2019 o 13:20 Arnd Bergmann napisa=C5=82(a): > > 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. Could you just add a comment so that it's clear at first glance? > > > > @@ -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. I would prefer not to have global state in the driver, let's just store the pointer in the data passed to gpiochip_add_data(). Bart > > > > +static inline u32 gpreg_read(unsigned long offset) > > > > Here and elsewhere: could you please keep the lpc32xx_gpio prefix for > > all symbols? > > Sure. > > Arnd